I suggest the attached patch.  When lv is at the beginning of the file,
the patch shows the file name only if it is shorter than the width of
the screen.  Rationale:
* the user will be more interested in the contents of the file than
  its name
* if the user wants to know the file name, he/she can press the "=" key
  at any time
* this problem can happen to any user; it is not very rare if you specify
  the file in its absolute path because lv shows the file name as it is
  given, not just its basename
* the change is minimal; usually the file name is shorter than the width
  of the screen and lv _does_ show it

-- 
Oohara Yuuma <[EMAIL PROTECTED]>

We are now being exorcised.
--- Satoko Kiyuduki "Kuro the Coffin Bearer"
diff -u -rN lv-4.51-unmodified/src/command.c lv-4.51/src/command.c
--- lv-4.51-unmodified/src/command.c    2007-02-28 22:34:49.000000000 +0900
+++ lv-4.51/src/command.c       2008-01-27 17:18:31.000000000 +0900
@@ -1158,8 +1158,15 @@
        else
          label = "(END)";
       }
-      if( TRUE == f->top )
+      if( TRUE == f->top ){
        label = FileName( f );
+        /* if the file name is not shorter than the width of the screen,
+         * it causes scrolling and moves the first line of the file
+         * out of the screen
+         */
+        if ( strlen(label) >= f->width )
+          label = NULL;
+      }
     }
 
     if( NULL != label ){

Reply via email to