]> granicus.if.org Git - vim/commitdiff
patch 8.2.0096: cannot create tiny popup window in last column v8.2.0096
authorBram Moolenaar <Bram@vim.org>
Mon, 6 Jan 2020 22:07:48 +0000 (23:07 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 6 Jan 2020 22:07:48 +0000 (23:07 +0100)
Problem:    Cannot create tiny popup window in last column. (Daniel Steinberg)
Solution:   Remove position limit. (closes #5447)

src/popupwin.c
src/testdir/dumps/Test_popupwin_20.dump
src/testdir/dumps/Test_popupwin_21.dump
src/testdir/test_popupwin.vim
src/version.c

index e65b4bf4404044d5c5f39fdde6c31733e07c1d13..c6296dfd2f7bceb9fb929ce6ddc137398fb01cb7 100644 (file)
@@ -1222,8 +1222,8 @@ popup_adjust_position(win_T *wp)
                || wp->w_popup_pos == POPPOS_BOTLEFT))
        {
            wp->w_wincol = wantcol - 1;
-           if (wp->w_wincol >= Columns - 3)
-               wp->w_wincol = Columns - 3;
+           if (wp->w_wincol >= Columns - 1)
+               wp->w_wincol = Columns - 1;
        }
     }
 
index 2989cd1301ae43dba2c7bbc3c320e062c9c0c0c5..707db58dd2adfe58186f93a5665b54b6e98297c6 100644 (file)
@@ -1,9 +1,9 @@
 >1+0&#ffffff0| @73
-|2| |++0#0000001#ffd7ff255|-@11|+| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|+|-@11|+| @18
-|3| ||+0#0000001#ffd7ff255|h|e|l@1|o| |b|o|r|d|e|r||| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255|h|e|l@1|o| |p|a|d@1|i|n|g| | +0#0000000#ffffff0@4||| @11||| @18
-|4| |++0#0000001#ffd7ff255|-@11|+| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4||| |h|e|l@1|o| |b|o|t|h| ||| @18
-|5| @40||| @11||| @18
-|6| |++0#0000001#ffd7ff255|-@8| +0#0000000#ffffff0@9| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|+|-@11|+| @18
+|2| |++0#0000001#ffd7ff255|-@11|+| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|+|-@11|+| @15|X+0#0000001#ffd7ff255| +0#0000000#ffffff0@1
+|3| ||+0#0000001#ffd7ff255|h|e|l@1|o| |b|o|r|d|e|r||| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255|h|e|l@1|o| |p|a|d@1|i|n|g| | +0#0000000#ffffff0@4||| @11||| @16|X+0#0000001#ffd7ff255| +0#0000000#ffffff0
+|4| |++0#0000001#ffd7ff255|-@11|+| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4||| |h|e|l@1|o| |b|o|t|h| ||| @17|X+0#0000001#ffd7ff255
+|5+0#0000000#ffffff0| @40||| @11||| @17|X+0#0000001#ffd7ff255
+|6+0#0000000#ffffff0| |++0#0000001#ffd7ff255|-@8| +0#0000000#ffffff0@9| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|+|-@11|+| @18
 |7| ||+0#0000001#ffd7ff255|b|o|r|d|e|r| |T|L| +0#0000000#ffffff0@9| +0#0000001#ffd7ff255@3|p|a|d@1|i|n|g|s| @2| +0#0000000#ffffff0@37
 |8| @20| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@12||+0#0000001#ffd7ff255| @2|w|r|a|p@1|e|d| |l|o|n|g|e|r| |t|e| @2||
 |9+0#0000000#ffffff0| @20| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@12||+0#0000001#ffd7ff255| @2|x|t| @17||
index 68594f98e6a3280872dab95e1593b271fb978779..9b6f4d000dbdf16cd2787367d55d377e666ab4d0 100644 (file)
@@ -1,9 +1,9 @@
 >1+0&#ffffff0| @73
-|2| |╔+0#0000001#ffd7ff255|═@11|╗| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|╔|═@11|╗| @18
-|3| |║+0#0000001#ffd7ff255|h|e|l@1|o| |b|o|r|d|e|r|║| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255|h|e|l@1|o| |p|a|d@1|i|n|g| | +0#0000000#ffffff0@4|║| @11|║| @18
-|4| |╚+0#0000001#ffd7ff255|═@11|╝| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|║| |h|e|l@1|o| |b|o|t|h| |║| @18
-|5| @40|║| @11|║| @18
-|6| |╔+0#0000001#ffd7ff255|═@8| +0#0000000#ffffff0@9| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|╚|═@11|╝| @18
+|2| |╔+0#0000001#ffd7ff255|═@11|╗| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|╔|═@11|╗| @15|X+0#0000001#ffd7ff255| +0#0000000#ffffff0@1
+|3| |║+0#0000001#ffd7ff255|h|e|l@1|o| |b|o|r|d|e|r|║| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255|h|e|l@1|o| |p|a|d@1|i|n|g| | +0#0000000#ffffff0@4|║| @11|║| @16|X+0#0000001#ffd7ff255| +0#0000000#ffffff0
+|4| |╚+0#0000001#ffd7ff255|═@11|╝| +0#0000000#ffffff0@5| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|║| |h|e|l@1|o| |b|o|t|h| |║| @17|X+0#0000001#ffd7ff255
+|5+0#0000000#ffffff0| @40|║| @11|║| @17|X+0#0000001#ffd7ff255
+|6+0#0000000#ffffff0| |╔+0#0000001#ffd7ff255|═@8| +0#0000000#ffffff0@9| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@4|╚|═@11|╝| @18
 |7| |║+0#0000001#ffd7ff255|b|o|r|d|e|r| |T|L| +0#0000000#ffffff0@9| +0#0000001#ffd7ff255@3|p|a|d@1|i|n|g|s| @2| +0#0000000#ffffff0@37
 |8| @20| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@12|║+0#0000001#ffd7ff255| @2|w|r|a|p@1|e|d| |l|o|n|g|e|r| |t|e| @2|║
 |9+0#0000000#ffffff0| @20| +0#0000001#ffd7ff255@14| +0#0000000#ffffff0@12|║+0#0000001#ffd7ff255| @2|x|t| @17|║
index d5ee7160a13363b3dd225047cc203cb336c343d0..94ea423c1b519b5848e257ef457569ade1426179 100644 (file)
@@ -89,6 +89,10 @@ func Test_popup_with_border_and_padding()
          call popup_create('paddings', #{line: 6, col: 23, padding: [1, 3, 2, 4]})
          call popup_create('wrapped longer text', #{line: 8, col: 55, padding: [0, 3, 0, 3], border: [0, 1, 0, 1]})
          call popup_create('right aligned text', #{line: 11, col: 56, wrap: 0, padding: [0, 3, 0, 3], border: [0, 1, 0, 1]})
+         call popup_create('X', #{line: 2, col: 73})
+         call popup_create('X', #{line: 3, col: 74})
+         call popup_create('X', #{line: 4, col: 75})
+         call popup_create('X', #{line: 5, col: 76})
     END
     call insert(lines, iter == 1 ? '' : 'set enc=latin1')
     call writefile(lines, 'XtestPopupBorder')
@@ -1634,8 +1638,8 @@ func s:VerifyPosition(p, msg, line, col, width, height)
 endfunc
 
 func Test_popup_position_adjust()
-  " Anything placed past 2 cells from of the right of the screen is moved to the
-  " left.
+  " Anything placed past the last cell on the right of the screen is moved to
+  " the left.
   "
   " When wrapping is disabled, we also shift to the left to display on the
   " screen, unless fixed is set.
@@ -1643,24 +1647,11 @@ func Test_popup_position_adjust()
   " Entries for cases which don't vary based on wrapping.
   " Format is per tests described below
   let both_wrap_tests = [
-       \       ['a', 5, &columns,        5, &columns - 2, 1, 1],
-       \       ['b', 5, &columns + 1,    5, &columns - 2, 1, 1],
-       \       ['c', 5, &columns - 1,    5, &columns - 2, 1, 1],
+       \       ['a', 5, &columns,        5, &columns, 1, 1],
+       \       ['b', 5, &columns + 1,    5, &columns, 1, 1],
+       \       ['c', 5, &columns - 1,    5, &columns - 1, 1, 1],
        \       ['d', 5, &columns - 2,    5, &columns - 2, 1, 1],
-       \       ['e', 5, &columns - 3,    5, &columns - 3, 1, 1],
-       \
-       \       ['aa', 5, &columns,        5, &columns - 2, 2, 1],
-       \       ['bb', 5, &columns + 1,    5, &columns - 2, 2, 1],
-       \       ['cc', 5, &columns - 1,    5, &columns - 2, 2, 1],
-       \       ['dd', 5, &columns - 2,    5, &columns - 2, 2, 1],
-       \       ['ee', 5, &columns - 3,    5, &columns - 3, 2, 1],
-       \
-       \       ['aaa', 5, &columns,        5, &columns - 2, 3, 1],
-       \       ['bbb', 5, &columns + 1,    5, &columns - 2, 3, 1],
-       \       ['ccc', 5, &columns - 1,    5, &columns - 2, 3, 1],
-       \       ['ddd', 5, &columns - 2,    5, &columns - 2, 3, 1],
-       \       ['eee', 5, &columns - 3,    5, &columns - 3, 3, 1],
-       \ ]
+       \       ['e', 5, &columns - 3,    5, &columns - 3, 1, 1]]
 
   " these test groups are dicts with:
   "  - comment: something to identify the group of tests by
@@ -1681,11 +1672,24 @@ func Test_popup_position_adjust()
        \     pos: 'botleft',
        \   },
        \   tests: both_wrap_tests + [
-       \       ['aaaa', 5, &columns,        4, &columns - 2, 3, 2],
-       \       ['bbbb', 5, &columns + 1,    4, &columns - 2, 3, 2],
-       \       ['cccc', 5, &columns - 1,    4, &columns - 2, 3, 2],
+       \       ['aa', 5, &columns,        4, &columns, 1, 2],
+       \       ['bb', 5, &columns + 1,    4, &columns, 1, 2],
+       \       ['cc', 5, &columns - 1,    5, &columns - 1, 2, 1],
+       \       ['dd', 5, &columns - 2,    5, &columns - 2, 2, 1],
+       \       ['ee', 5, &columns - 3,    5, &columns - 3, 2, 1],
+       \
+       \       ['aaa', 5, &columns,        3, &columns, 1, 3],
+       \       ['bbb', 5, &columns + 1,    3, &columns, 1, 3],
+       \       ['ccc', 5, &columns - 1,    4, &columns - 1, 2, 2],
+       \       ['ddd', 5, &columns - 2,    5, &columns - 2, 3, 1],
+       \       ['eee', 5, &columns - 3,    5, &columns - 3, 3, 1],
+       \
+       \       ['aaaa', 5, &columns,        2, &columns, 1, 4],
+       \       ['bbbb', 5, &columns + 1,    2, &columns, 1, 4],
+       \       ['cccc', 5, &columns - 1,    4, &columns - 1, 2, 2],
        \       ['dddd', 5, &columns - 2,    4, &columns - 2, 3, 2],
        \       ['eeee', 5, &columns - 3,    5, &columns - 3, 4, 1],
+       \       ['eeee', 5, &columns - 4,    5, &columns - 4, 4, 1],
        \   ],
        \ },
        \ #{
@@ -1695,6 +1699,18 @@ func Test_popup_position_adjust()
        \     pos: 'botleft',
        \   },
        \   tests: both_wrap_tests + [
+       \       ['aa', 5, &columns,        5, &columns - 1, 2, 1],
+       \       ['bb', 5, &columns + 1,    5, &columns - 1, 2, 1],
+       \       ['cc', 5, &columns - 1,    5, &columns - 1, 2, 1],
+       \       ['dd', 5, &columns - 2,    5, &columns - 2, 2, 1],
+       \       ['ee', 5, &columns - 3,    5, &columns - 3, 2, 1],
+       \
+       \       ['aaa', 5, &columns,        5, &columns - 2, 3, 1],
+       \       ['bbb', 5, &columns + 1,    5, &columns - 2, 3, 1],
+       \       ['ccc', 5, &columns - 1,    5, &columns - 2, 3, 1],
+       \       ['ddd', 5, &columns - 2,    5, &columns - 2, 3, 1],
+       \       ['eee', 5, &columns - 3,    5, &columns - 3, 3, 1],
+       \
        \       ['aaaa', 5, &columns,        5, &columns - 3, 4, 1],
        \       ['bbbb', 5, &columns + 1,    5, &columns - 3, 4, 1],
        \       ['cccc', 5, &columns - 1,    5, &columns - 3, 4, 1],
@@ -1710,9 +1726,21 @@ func Test_popup_position_adjust()
        \     pos: 'botleft',
        \   },
        \   tests: both_wrap_tests + [
-       \       ['aaaa', 5, &columns,        5, &columns - 2, 3, 1],
-       \       ['bbbb', 5, &columns + 1,    5, &columns - 2, 3, 1],
-       \       ['cccc', 5, &columns - 1,    5, &columns - 2, 3, 1],
+       \       ['aa', 5, &columns,        5, &columns, 1, 1],
+       \       ['bb', 5, &columns + 1,    5, &columns, 1, 1],
+       \       ['cc', 5, &columns - 1,    5, &columns - 1, 2, 1],
+       \       ['dd', 5, &columns - 2,    5, &columns - 2, 2, 1],
+       \       ['ee', 5, &columns - 3,    5, &columns - 3, 2, 1],
+       \
+       \       ['aaa', 5, &columns,        5, &columns, 1, 1],
+       \       ['bbb', 5, &columns + 1,    5, &columns, 1, 1],
+       \       ['ccc', 5, &columns - 1,    5, &columns - 1, 2, 1],
+       \       ['ddd', 5, &columns - 2,    5, &columns - 2, 3, 1],
+       \       ['eee', 5, &columns - 3,    5, &columns - 3, 3, 1],
+       \
+       \       ['aaaa', 5, &columns,        5, &columns, 1, 1],
+       \       ['bbbb', 5, &columns + 1,    5, &columns, 1, 1],
+       \       ['cccc', 5, &columns - 1,    5, &columns - 1, 2, 1],
        \       ['dddd', 5, &columns - 2,    5, &columns - 2, 3, 1],
        \       ['eeee', 5, &columns - 3,    5, &columns - 3, 4, 1],
        \   ],
index d007585eaca4a994aec918c04a5582551d2ef482..f51df26c4bcf6fa99a479972cd98463e33303a67 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    96,
 /**/
     95,
 /**/