summaryrefslogtreecommitdiffstats
path: root/system/lv/patches/shows-the-filename-only.diff
blob: 32912b4209680ec4cf414601978fa7919c6e9ba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: shows the file name only if it is shorter than the width of the screen.
Author: Oohara Yuuma <oohara@libra.interq.or.jp>
Last-Update: 2008-01-27

Index: lv/src/command.c
===================================================================
--- lv.orig/src/command.c
+++ lv/src/command.c
@@ -1173,8 +1173,15 @@ public void Command( file_t *file, byte
 	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 ){