]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0713: completion: ruler not updated correctly when the popup menu is visible v9.2.0713
authorHirohito Higashi <h.east.727@gmail.com>
Tue, 23 Jun 2026 21:02:46 +0000 (21:02 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 23 Jun 2026 21:02:46 +0000 (21:02 +0000)
Problem:  While the insert-mode completion popup menu is visible, the
          ruler - and the ruler shown in a status line when 'laststatus'
          is set - shows the column where the completion started instead
          of the real cursor column. With a status line the ruler can
          also stay at the column from before the completion until the
          next key is pressed.
Solution: Position the popup menu at the completion start column without
          moving the cursor there, so the ruler keeps reflecting the
          real cursor column.  Also mark the status line for redraw
          before the menu is shown, so its ruler is updated for the real
          cursor column while the menu is visible.

closes: #20626

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
28 files changed:
src/cmdexpand.c
src/insexpand.c
src/popupmenu.c
src/proto/popupmenu.pro
src/testdir/dumps/Test_autocompletedelay_1.dump
src/testdir/dumps/Test_autocompletedelay_4.dump
src/testdir/dumps/Test_autocompletedelay_longest_2.dump
src/testdir/dumps/Test_autocompletedelay_longest_4.dump
src/testdir/dumps/Test_autocompletedelay_preinsert_2.dump
src/testdir/dumps/Test_fuzzy_autocompletedelay_1.dump
src/testdir/dumps/Test_fuzzy_autocompletedelay_2.dump
src/testdir/dumps/Test_info_popupwin_clears_cmdline_on_hide_01.dump
src/testdir/dumps/Test_popup_and_previewwindow_pbuffer.dump
src/testdir/dumps/Test_popup_and_previewwindow_pedit.dump
src/testdir/dumps/Test_pum_highlights_09.dump
src/testdir/dumps/Test_pum_matchins_11.dump
src/testdir/dumps/Test_pum_statusline_ruler_1.dump [new file with mode: 0644]
src/testdir/dumps/Test_pum_with_preview_win.dump
src/testdir/dumps/Test_pum_with_special_characters_13.dump
src/testdir/dumps/Test_pumopt_opacity_text_attrs.dump
src/testdir/dumps/Test_pumopt_opacity_textprop_undercurl.dump
src/testdir/dumps/Test_pumopt_opacity_wide_bg.dump
src/testdir/dumps/Test_pumopt_opacity_wide_bg_shifted.dump
src/testdir/dumps/Test_shortmess_complmsg_2.dump
src/testdir/dumps/Test_winhighlight_8.dump
src/testdir/dumps/Test_winhighlight_9.dump
src/testdir/test_ins_complete.vim
src/version.c

index 496ab7b8831383d2aeb5442bcfc78588b0913ea1..961ced5773d60ba19fa259ea35e06cd7e03c11d5 100644 (file)
@@ -458,7 +458,7 @@ cmdline_pum_display(void)
 {
     if (p_po > 0 && p_po < 100 && !pum_redraw_in_same_position())
        pum_call_update_screen();
-    pum_display(compl_match_array, compl_match_arraysize, compl_selected);
+    pum_display(compl_match_array, compl_match_arraysize, compl_selected, -1);
 }
 
 /*
index 3b20d2a3c79a9ab9be3592b1563b0696d05562ad..f5ad9400816b4fcb1766d66ac77ea40da95dc947 100644 (file)
@@ -1889,22 +1889,19 @@ ins_compl_show_pum(void)
     // part of the screen would be updated.  We do need to redraw here.
     dollar_vcol = -1;
 
-    // Compute the screen column of the start of the completed text.
-    // Use the cursor to get all wrapping and other settings right.
+    // Position the menu at the completion start without moving the cursor
+    // there, so the ruler keeps showing the real cursor column.
     col = curwin->w_cursor.col;
     curwin->w_cursor.col = compl_col;
-    compl_selected_item = cur;
-    pum_display(compl_match_array, compl_match_arraysize, cur);
+    validate_cursor_col();
+    int pum_wcol = curwin->w_wcol;
     curwin->w_cursor.col = col;
-
-#ifdef FEAT_CONCEAL
-    // The cursor was temporarily moved to "compl_col" above to position the
-    // menu, so the screen update left w_wcol conceal-corrected for that column
-    // rather than for the real cursor.  Redraw the cursor line so the caret is
-    // positioned correctly when the cursor line has concealed text.
-    if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin))
-       redrawWinline(curwin, curwin->w_cursor.lnum);
-#endif
+    validate_cursor_col();
+    compl_selected_item = cur;
+    // Flag the status line so the ruler is redrawn for the real cursor column
+    // when the menu update redraws the screen.
+    curwin->w_redr_status = true;
+    pum_display(compl_match_array, compl_match_arraysize, cur, pum_wcol);
 
     // After adding leader, set the current match to shown match.
     if (compl_started && compl_curr_match != compl_shown_match)
index bed2495b87f1d7ffab8f7e1d198e9e76f1be1875..08aa442865f04e4cae444b529b2bc702a1ea8e03 100644 (file)
@@ -290,8 +290,10 @@ pum_compute_horizontal_placement(int cursor_col)
 pum_display(
        pumitem_T   *array,
        int         size,
-       int         selected)   // index of initially selected item, -1 if
+       int         selected,   // index of initially selected item, -1 if
                                // out of range
+       int         pum_wcol)   // screen column to align the menu to, or -1
+                               // to use the cursor column
 {
     int            cursor_col;
     int            above_row;
@@ -326,7 +328,7 @@ pum_display(
            pum_win_row = curwin->w_wrow + W_WINROW(curwin);
        pum_win_height = curwin->w_height;
        pum_win_col = curwin->w_wincol;
-       pum_win_wcol = curwin->w_wcol;
+       pum_win_wcol = pum_wcol >= 0 ? pum_wcol : curwin->w_wcol;
        pum_win_width = curwin->w_width;
 
 #if defined(FEAT_QUICKFIX)
@@ -359,8 +361,9 @@ pum_display(
            cursor_col = cmdline_compl_startcol();
        else
        {
-           // w_wcol includes virtual text "above"
-           int wcol = curwin->w_wcol % curwin->w_width;
+           int wcol = pum_wcol >= 0 ? pum_wcol : curwin->w_wcol;
+           // w_wcol includes virtual text "above".
+           wcol %= curwin->w_width;
 #ifdef FEAT_CONCEAL
            // w_wcol does not account for text concealed before the cursor;
            // shift by the offset win_line() recorded for the cursor line so the
@@ -1671,16 +1674,11 @@ pum_may_redraw(void)
     }
     else
     {
-       int wcol = curwin->w_wcol;
-
        // Window layout changed, recompute the position.
        // Use the remembered w_wcol value, the cursor may have moved when a
        // completion was inserted, but we want the menu in the same position.
        pum_undisplay();
-       curwin->w_wcol = pum_win_wcol;
-       curwin->w_valid |= VALID_WCOL;
-       pum_display(array, len, selected);
-       curwin->w_wcol = wcol;
+       pum_display(array, len, selected, pum_win_wcol);
     }
 }
 
index 4afd678125cd459ef19d23bbd9ce871c8c58ae96..f7a00511cfecc94d2138af9ed5067d5f553e2488 100644 (file)
@@ -2,7 +2,7 @@
 void pum_set_border(int enable);
 void pum_set_shadow(int enable);
 void pum_set_margin(int enable);
-void pum_display(pumitem_T *array, int size, int selected);
+void pum_display(pumitem_T *array, int size, int selected, int pum_wcol);
 void pum_call_update_screen(void);
 int pum_under_menu(int row, int col, int only_redrawing);
 void pum_opacity_changed(void);
index 51128fc2f328e46366722b93fedefa04cc8df8c6..c792e09ea93a15ecf64451d7e14d7c099906e1b9 100644 (file)
@@ -7,4 +7,4 @@
 |f+0#0000001#ffd7ff255|o@1| @11| +0#4040ff13#ffffff0@59
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|1| @10|T|o|p
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|2| @10|A|l@1
index 53199f9d6020ac189c93beb0dac2d210a5b74dc1..31d58c55c1061fa94437c5712f6c6e289b9a9dbe 100644 (file)
@@ -7,4 +7,4 @@
 |f+0#0000001#ffd7ff255|o@1| @11| +0#4040ff13#ffffff0@59
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|1| @10|A|l@1| 
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|3| @10|A|l@1| 
index 19a83bfa7839547cfb801f8abda1c5e7f95ea072..8d7eabd6057cc00fe87a1db630894320e2e6d8c3 100644 (file)
@@ -7,4 +7,4 @@
 |~| @73
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|3|,|1| @10|T|o|p
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|3|,|6| @10|A|l@1
index 09a8514da02b447485dc541c9cbb5bfe77d2ec36..95a4857bd2e1472817e1e9da9a33e32ca6619bc7 100644 (file)
@@ -7,4 +7,4 @@
 |~| @73
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|3|,|1| @10|A|l@1| 
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|3|,|3| @10|A|l@1| 
index 17252dfa3eb75d41e97f20a697971398be9376bb..6b6520925e602f04b577f0d8ae550ed3dfe3b7de 100644 (file)
@@ -7,4 +7,4 @@
 |~| @73
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|3|,|1| @10|A|l@1| 
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|3|,|3| @10|A|l@1| 
index ed15dc9627be9f5f08405a174facdfc52e99ee24..b82983f94bd3723e3eb82f8d25dfa3ca2afdecc8 100644 (file)
@@ -7,4 +7,4 @@
 |~| @73
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|1| @10|T|o|p
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|3| @10|A|l@1
index 84083f66345eae07a63b4f8fc9d8b6c64dffdf4b..550f1e154c912f0492af4760d65a3d821b6cc7f5 100644 (file)
@@ -7,4 +7,4 @@
 |v+0#0000001#ffd7ff255|i|m| @11| +0#4040ff13#ffffff0@59
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|1| @10|A|l@1| 
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|2| @10|A|l@1| 
index 27947cd33fbbcfd8b48f08f4ae6e9058f6230ec8..b098b70f6ddf7e57bdf6b2b4f253ee3b459192e0 100644 (file)
@@ -12,4 +12,4 @@
 |f+0#0000001#ffd7ff255|o|u|r| @10| +0#0000000#ffffff0@59
 |f+0#0000001#e0e0e08|i|v|e| @11|o|n|e| @2| +0#0000000#ffffff0@52
 |f|i|v|e> @10| +0#0000001#e0e0e08|t|w|o| @2| +0#0000000#ffffff0@52
-|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@2| +0#0000001#e0e0e08|t|h|r|e@1| | +0#0000000#ffffff0@34|1|6|,|1| @9|B|o|t| 
+|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@2| +0#0000001#e0e0e08|t|h|r|e@1| | +0#0000000#ffffff0@34|1|6|,|5| @9|B|o|t| 
index 0eab2a62c63e5d94dc374e8927a3f24406736446..e01908c6b18ed8528edf7e0f44685de7ee8ff8af 100644 (file)
@@ -16,5 +16,5 @@
 |a|b|0> @71
 |~+0#4040ff13&| @73
 |~| @73
-|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1@1|,|1| @10|B|o|t
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1@1|,|4| @10|B|o|t
 |-+2&&@1| |K|e|y|w|o|r|d| |L|o|c|a|l| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |1|0| +0#0000000&@26
index b235c7d511b02d7e51fa385d792fa3e4d46ab633..fe27c9d6c1f92d40e1fee04e824d7c5bf10efbcd 100644 (file)
@@ -16,5 +16,5 @@
 |a+0#0000001#ffd7ff255|b|6| @11| +0#0000000#a8a8a8255| +0&#ffffff0@58
 |a|b|0> @71
 |~+0#4040ff13&| @73
-|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1@1|,|1| @10|B|o|t
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1@1|,|4| @10|B|o|t
 |-+2&&@1| |K|e|y|w|o|r|d| |L|o|c|a|l| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |1|0| +0#0000000&@26
index 4e7d08b79362db59ce9bb37a793bfd254fd7175c..552f3361a24e995f864cced64c5c2f53c375b54d 100644 (file)
@@ -17,4 +17,4 @@
 |~| @73
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|1| @10|A|l@1| 
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|2| @10|A|l@1| 
index a44a6ee566686421b1c965f3345ecf962c34e914..d11ba8c04896e3d3c940cc560347916785dc0e2c 100644 (file)
@@ -16,5 +16,5 @@
 |~| @73
 |~| @73
 |~| @73
-|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|A|l@1
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|4| @11|A|l@1
 |-+2&&@1| |O|m|n|i| |c|o|m|p|l|e|t|i|o|n| |(|^|O|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@34
diff --git a/src/testdir/dumps/Test_pum_statusline_ruler_1.dump b/src/testdir/dumps/Test_pum_statusline_ruler_1.dump
new file mode 100644 (file)
index 0000000..43de9b6
--- /dev/null
@@ -0,0 +1,8 @@
+|a+0&#ffffff0@1| |a@2| |a@1> @30
+|~+0#4040ff13&| @4| +0#0000001#e0e0e08|a@1| @12| +0#4040ff13#ffffff0@17
+|~| @4| +0#0000001#ffd7ff255|a@2| @11| +0#4040ff13#ffffff0@17
+|~| @38
+|~| @38
+|~| @38
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @8|1|,|1|0| @10|A|l@1
+|-+2&&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@24
index ad0df781462f8a30ef31bfa483baffcc51c48bf5..d2487bfdb67abccad99da037f1a69b2a67890fb6 100644 (file)
@@ -8,5 +8,5 @@
 |t+0#0000001#ffd7ff255|h|r|e@1| @9| +0#4040ff13#ffffff0@59
 |~| @73
 |~| @73
-|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|A|l@1
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|4| @11|A|l@1
 |-+2&&@1| |O|m|n|i| |c|o|m|p|l|e|t|i|o|n| |(|^|O|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@34
index 313d5007832d48e9099caff567f4f2f856e5f410..3ed2c9573da4ec3e2bc5acd8367c3a22a4ccbe9b 100644 (file)
@@ -9,4 +9,4 @@
 |~| @73
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|3|,|1| @10|A|l@1| 
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|3|,|5| @10|A|l@1| 
index 62e7df726b4196db4a3fa3bd553ebf3894d1436b..1d708e641bfb4e9514b815cf08d08ca78529dd39 100644 (file)
@@ -17,4 +17,4 @@
 |ほ*&|げ|ほ|げ|ほ|げ|漢*4#e000e06&|字|テ|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
 |ほ*&|げ|ほ|げ|ほ|げ|漢*4#e000e06&|字|テ|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
 |ほ*&|げ|ほ|げ|ほ|げ|漢*4#e000e06&|字|テ|ス|ト|あ*0#0000000&|い|う|え|お|カ|タ|カ|ナ| +&@34
-|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|1| @10|T|o|p| 
+|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|7|-|5| @8|T|o|p| 
index a1242fde84796f059bf0d941e1cc089f2358e3df..2558f5bf1ac6cff47021348ee0088f7af743e387 100644 (file)
@@ -17,4 +17,4 @@
 |~| @73
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|1| @10|A|l@1| 
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|1|3| @9|A|l@1| 
index 6b9bb9935a0c5978565727a76ec35423214be586..23c67a84cfac643268935f974124f1e29f69945a 100644 (file)
@@ -17,4 +17,4 @@
 |ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
 |ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
 |ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
-|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|1| @10|T|o|p| 
+|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|7|-|5| @8|T|o|p| 
index f67556307b750a5aba5b2e57cab79c99e98509a3..4aee9cd6aa27e8eb44bc348fadfc5c24cfa82887 100644 (file)
@@ -17,4 +17,4 @@
 |a|ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@33
 |ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@34
 |a|ほ*&|げ|ほ|げ|ほ|げ|漢|字|テ|ス|ト|あ|い|う|え|お|カ|タ|カ|ナ| +&@33
-|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|1| @10|T|o|p| 
+|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|7|-|5| @8|T|o|p| 
index 66c421b59a4c1eb1762561a195bb729ab406b229..99d03a4ec73c8b88260dac8383f60b32c5ceefea 100644 (file)
@@ -9,4 +9,4 @@
 |~| @73
 |~| @73
 |~| @73
-|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|1| @10|A|l@1| 
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|6| @10|A|l@1| 
index 69568fc95c8f8cf07098367c5db53343d8483ae5..c5ff0525035a441eb8308f9b525b4f3c81718a1e 100644 (file)
@@ -4,5 +4,5 @@
 |w+0#0000001#ffd7ff255|a+0#ffffff16#e000002|l@1| @10| +0#0000000#a8a8a8255| +0&#ffffff0@20||+1&&|S+0&&|i|x| @33
 |w+0#0000001#ffd7ff255|h+0#ffffff16#e000002|i|l|e| @9| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@20||+1#0000000&|~+0#4040ff13&| @35
 |w+0#0000001#ffd7ff255|i+0#ffffff16#e000002|n|c|m|d| @8| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@20||+1#0000000&|~+0#4040ff13&| @35
-|w+0#0000001#ffd7ff255|i+0#ffffff16#e000002|n|d|o| @9| +0#0000000#a8a8a8255| +3&#ffffff0@2|1|,|1| @11|A|l@1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|A|l@1
+|w+0#0000001#ffd7ff255|i+0#ffffff16#e000002|n|d|o| @9| +0#0000000#a8a8a8255| +3&#ffffff0@2|1|,|6| @11|A|l@1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|A|l@1
 |-+2&&@1| |C|o|m@1|a|n|d|-|l|i|n|e| |c|o|m|p|l|e|t|i|o|n| |(|^|V|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |1|5| +0#0000000&@25
index 174531af7105b4e15b7808566a1a3104bede5d5a..67877d088977f412d72c7dd9244274a9f686810f 100644 (file)
@@ -4,5 +4,5 @@
 |S|i|x| @33| +0#0000001#ffd7ff255|w|a|l@1| @10| +0#0000000#a8a8a8255| +0&#ffffff0@20
 |~+0#4040ff13&| @35| +0#0000001#ffd7ff255|w|h|i|l|e| @9| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@20
 |~| @35| +0#0000001#ffd7ff255|w|i|n|c|m|d| @8| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@20
-|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|5| @11|A|l@1| +0#0000001#ffd7ff255|w|i|n|d|o| @9| +0#0000000#a8a8a8255| +3&#ffffff0@2|1|,|1| @11|A|l@1
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|5| @11|A|l@1| +0#0000001#ffd7ff255|w|i|n|d|o| @9| +0#0000000#a8a8a8255| +3&#ffffff0@2|1|,|6| @11|A|l@1
 |-+2&&@1| |C|o|m@1|a|n|d|-|l|i|n|e| |c|o|m|p|l|e|t|i|o|n| |(|^|V|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |1|5| +0#0000000&@25
index cb901d609f5a42077caa5e61c90ffdb2699f3062..4df2efb0616eee819db90a4df6aa47604a30dd01 100644 (file)
@@ -1025,6 +1025,24 @@ func Test_pum_with_preview_win()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_pum_statusline_ruler()
+  CheckScreendump
+
+  " With a status line, the ruler must follow the real cursor column after a
+  " completion inserts text, not stay at the completion start column.
+  let lines =<< trim END
+    call setline(1, 'aa aaa ')
+    set laststatus=2 ruler
+  END
+  call writefile(lines, 'Xstlruler', 'D')
+  let buf = RunVimInTerminal('-S Xstlruler', #{rows: 8, cols: 40})
+  call term_sendkeys(buf, "A\<C-N>")
+  call VerifyScreenDump(buf, 'Test_pum_statusline_ruler_1', {})
+
+  call term_sendkeys(buf, "\<Esc>")
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_scrollbar_on_wide_char()
   CheckScreendump
 
index b03ecdf3072f153f05cac04488f61349f36d05ef..02d7bc410e810a146225577bc814477a75767a78 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    713,
 /**/
     712,
 /**/