]> granicus.if.org Git - vim/commitdiff
patch 8.2.0359: popup_atcursor() may hang v8.2.0359
authorBram Moolenaar <Bram@vim.org>
Fri, 6 Mar 2020 20:43:17 +0000 (21:43 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 6 Mar 2020 20:43:17 +0000 (21:43 +0100)
Problem:    popup_atcursor() may hang. (Yasuhiro Matsumoto)
Solution:   Take the decoration into account. (closes #5728)

src/popupwin.c
src/testdir/test_popupwin.vim
src/version.c

index 45d64880590a4a5e744237c4222b056d71597717..3c85e3d567bbea825678948e7d9459103cfe7c49 100644 (file)
@@ -1232,8 +1232,9 @@ popup_adjust_position(win_T *wp)
                || wp->w_popup_pos == POPPOS_BOTLEFT))
        {
            wp->w_wincol = wantcol - 1;
-           if (wp->w_wincol >= Columns - 1)
-               wp->w_wincol = Columns - 1;
+           // Need to see at least one character after the decoration.
+           if (wp->w_wincol > Columns - left_extra - 1)
+               wp->w_wincol = Columns - left_extra - 1;
        }
     }
 
index ebc8c430693cf57b6bff06bbf597468186915c24..d89824df0db2a0f8fb0c4ba97c0dbf9bed045ed6 100644 (file)
@@ -3293,4 +3293,17 @@ func Test_popupwin_filter_input_multibyte()
   unlet g:bytes
 endfunc
 
+func Test_popupwin_atcursor_far_right()
+  new
+
+  " this was getting stuck
+  set signcolumn=yes
+  call setline(1, repeat('=', &columns))
+  normal! ggg$
+  call popup_atcursor(repeat('x', 500), #{moved: 'any', border: []})
+
+  bwipe!
+  set signcolumn&
+endfunc
+
 " vim: shiftwidth=2 sts=2
index 7e2bd38239c6c38b3ce83ee9b7e4bf525a9c29da..e6c6bc94de14d36343f4c853c07c4290d27e8eb4 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    359,
 /**/
     358,
 /**/