]> granicus.if.org Git - vim/commitdiff
patch 7.4.2109 v7.4.2109
authorBram Moolenaar <Bram@vim.org>
Wed, 27 Jul 2016 21:26:04 +0000 (23:26 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 27 Jul 2016 21:26:04 +0000 (23:26 +0200)
Problem:    Setting 'display' to "lastline" is a drastic change, while
            omitting it results in lots of "@" lines.
Solution:   Add "truncate" to show "@@@" for a truncated line.

runtime/doc/options.txt
src/option.h
src/screen.c
src/version.c

index ea247e289133374d3f9c50fc616affa77f3a63cb..bfa806843d95a2335feea48de829342a648073da 100644 (file)
@@ -2623,11 +2623,17 @@ A jump table for the options with a short description can be found at |Q_op|.
        Change the way text is displayed.  This is comma separated list of
        flags:
        lastline        When included, as much as possible of the last line
-                       in a window will be displayed.  When not included, a
-                       last line that doesn't fit is replaced with "@" lines.
+                       in a window will be displayed.  "@@@" is put in the
+                       last columns of the last screen line to indicate the
+                       rest of the line is not displayed.
+       truncate        Like "lastline", but "@@@" is displayed in the first
+                       column of the last screen line.  Overrules "lastline".
        uhex            Show unprintable characters hexadecimal as <xx>
                        instead of using ^C and ~C.
 
+       When neither "lastline" or "truncate" is included, a last line that
+       doesn't fit is replaced with "@" lines.
+
                                                *'eadirection'* *'ead'*
 'eadirection' 'ead'    string  (default "both")
                        global
index f05a4669511feba4f0e690b1dad6c85ce5cc88cf..bc8d4e0cf600bee9d25fa5a414ea522db524f516 100644 (file)
@@ -454,10 +454,11 @@ EXTERN char_u     *p_dir;         /* 'directory' */
 EXTERN char_u  *p_dy;          /* 'display' */
 EXTERN unsigned        dy_flags;
 #ifdef IN_OPTION_C
-static char *(p_dy_values[]) = {"lastline", "uhex", NULL};
+static char *(p_dy_values[]) = {"lastline", "truncate", "uhex", NULL};
 #endif
 #define DY_LASTLINE            0x001
-#define DY_UHEX                        0x002
+#define DY_TRUNCATE            0x002
+#define DY_UHEX                        0x004
 EXTERN int     p_ed;           /* 'edcompatible' */
 #ifdef FEAT_WINDOWS
 EXTERN char_u  *p_ead;         /* 'eadirection' */
index 1b364a4a2c5c9088ff227c88fe0e72a3b7606cab..b16bd87c7c46a4ce2c37ed13ef8e7954492565b3 100644 (file)
@@ -2018,7 +2018,7 @@ win_update(win_T *wp)
                    && wp->w_lines[idx].wl_valid
                    && wp->w_lines[idx].wl_lnum == lnum
                    && lnum > wp->w_topline
-                   && !(dy_flags & DY_LASTLINE)
+                   && !(dy_flags & (DY_LASTLINE | DY_TRUNCATE))
                    && srow + wp->w_lines[idx].wl_size > wp->w_height
 #ifdef FEAT_DIFF
                    && diff_check_fill(wp, lnum) == 0
@@ -2139,6 +2139,21 @@ win_update(win_T *wp)
            wp->w_filler_rows = wp->w_height - srow;
        }
 #endif
+       else if (dy_flags & DY_TRUNCATE)        /* 'display' has "truncate" */
+       {
+           int scr_row = W_WINROW(wp) + wp->w_height - 1;
+
+           /*
+            * Last line isn't finished: Display "@@@" in the last screen line.
+            */
+           screen_puts_len((char_u *)"@@", 2, scr_row, W_WINCOL(wp),
+                                                             hl_attr(HLF_AT));
+           screen_fill(scr_row, scr_row + 1,
+                   (int)W_WINCOL(wp) + 2, (int)W_ENDCOL(wp),
+                   '@', ' ', hl_attr(HLF_AT));
+           set_empty_rows(wp, srow);
+           wp->w_botline = lnum;
+       }
        else if (dy_flags & DY_LASTLINE)        /* 'display' has "lastline" */
        {
            /*
index 47417bf8fb2ac8259da8f6bd91cb3fb183756bf3..c24cf7a8010cba87c59c76a354d6c19d616589d5 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2109,
 /**/
     2108,
 /**/