diff src/screen.c @ 16839:032d5335987e v8.1.1421

patch 8.1.1421: drawing "~" line in popup window commit https://github.com/vim/vim/commit/1714696600f2859f897f4ffb33cedb5de09eded3 Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 30 00:12:11 2019 +0200 patch 8.1.1421: drawing "~" line in popup window Problem: Drawing "~" line in popup window. Solution: Just draw text in the last line of the popup window.
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 May 2019 00:15:05 +0200
parents 7cade95272c4
children 998603a243d7
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -1030,6 +1030,12 @@ update_popups(void)
 
 	if (lowest_wp == NULL)
 	    break;
+
+	// Recompute the position if the text changed.
+	if (lowest_wp->w_popup_last_changedtick
+					   != CHANGEDTICK(lowest_wp->w_buffer))
+	    popup_adjust_position(lowest_wp);
+
 	win_update(lowest_wp);
 	lowest_wp->w_popup_flags |= POPF_REDRAWN;
     }
@@ -2119,6 +2125,9 @@ win_update(win_T *wp)
 		    && wp->w_lines[idx].wl_lnum == lnum
 		    && lnum > wp->w_topline
 		    && !(dy_flags & (DY_LASTLINE | DY_TRUNCATE))
+#ifdef FEAT_TEXT_PROP
+		    && !bt_popup(wp->w_buffer)
+#endif
 		    && srow + wp->w_lines[idx].wl_size > wp->w_height
 #ifdef FEAT_DIFF
 		    && diff_check_fill(wp, lnum) == 0
@@ -2274,6 +2283,13 @@ win_update(win_T *wp)
 	    wp->w_filler_rows = wp->w_height - srow;
 	}
 #endif
+#ifdef FEAT_TEXT_PROP
+	else if (bt_popup(wp->w_buffer))
+	{
+	    // popup line that doesn't fit is left as-is
+	    wp->w_botline = lnum;
+	}
+#endif
 	else if (dy_flags & DY_TRUNCATE)	/* 'display' has "truncate" */
 	{
 	    int scr_row = W_WINROW(wp) + wp->w_height - 1;
@@ -2334,7 +2350,11 @@ win_update(win_T *wp)
 
 	// Make sure the rest of the screen is blank
 	// put '~'s on rows that aren't part of the file.
-	win_draw_end(wp, '~', ' ', FALSE, row, wp->w_height, HLF_EOB);
+	win_draw_end(wp,
+#ifdef FEAT_TEXT_PROP
+		bt_popup(wp->w_buffer) ? ' ' :
+#endif
+				  '~', ' ', FALSE, row, wp->w_height, HLF_EOB);
     }
 
 #ifdef SYN_TIME_LIMIT