[vim/vim] Trigger incsearch on cmdline paste (PR #11960)

5 views
Skip to first unread message

K.Takata

unread,
Feb 8, 2023, 2:09:32 AM2/8/23
to vim/vim, Subscribed

Inserting register literally (e.g. Ctrl-R + or Ctrl-R Ctrl-R ") in commandline didn't trigger incsearch or hlsearch.

Steps to reproduce:

  1. vim --clean --cmd 'set incsearch hlsearch | let @"="text" | put'
  2. Type / to start searching then type Ctrl-R Ctrl-R ".
    Unexpectedly, text is not highlighted.

I also found that cmdline_insert_reg() returns only CMDLINE_NOT_CHANGED or GOTO_NORMAL_MODE. So, the checks of the returned value was redundant and the goto cmdline_changed; line was not executed.

This PR fixes them.
(I'm not sure how to add a test for this...)


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/11960

Commit Summary

  • 58059e6 Trigger incsearch on cmdline paste

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11960@github.com>

K.Takata

unread,
Feb 8, 2023, 2:27:56 AM2/8/23
to vim/vim, Push

@k-takata pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11960/push/12547408053@github.com>

K.Takata

unread,
Feb 8, 2023, 2:35:14 AM2/8/23
to vim/vim, Push

@k-takata pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11960/push/12547470780@github.com>

K.Takata

unread,
Feb 8, 2023, 2:41:47 AM2/8/23
to vim/vim, Push

@k-takata pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11960/push/12547527062@github.com>

codecov[bot]

unread,
Feb 8, 2023, 2:52:28 AM2/8/23
to vim/vim, Subscribed

Codecov Report

Merging #11960 (32f0211) into master (6642982) will decrease coverage by 0.82%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@

##           master   #11960      +/-   ##

==========================================

- Coverage   81.90%   81.08%   -0.82%     

==========================================

  Files         164      154      -10     

  Lines      193719   183288   -10431     

  Branches    43796    41373    -2423     

==========================================

- Hits       158666   148621   -10045     

+ Misses      22218    21701     -517     

- Partials    12835    12966     +131     
Flag Coverage Δ
huge-clang-none 82.62% <87.50%> (+<0.01%) ⬆️
huge-gcc-none ?
huge-gcc-testgui ?
huge-gcc-unittests 0.29% <0.00%> (-0.01%) ⬇️
linux 81.08% <87.50%> (-1.26%) ⬇️
mingw-x64-HUGE ?
mingw-x86-HUGE ?
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/ex_getln.c 83.70% <87.50%> (-2.33%) ⬇️
src/if_perl.xs 54.50% <0.00%> (-17.82%) ⬇️
src/regexp_nfa.c 80.52% <0.00%> (-9.11%) ⬇️
src/arabic.c 85.86% <0.00%> (-8.70%) ⬇️
src/typval.c 82.00% <0.00%> (-7.99%) ⬇️
src/regexp_bt.c 78.52% <0.00%> (-7.46%) ⬇️
src/vim9execute.c 82.32% <0.00%> (-6.96%) ⬇️
src/json.c 77.84% <0.00%> (-5.47%) ⬇️
src/vim9instr.c 76.94% <0.00%> (-4.96%) ⬇️
src/vim9compile.c 86.70% <0.00%> (-4.54%) ⬇️
... and 137 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11960/c1422175796@github.com>

K.Takata

unread,
Feb 8, 2023, 3:21:16 AM2/8/23
to vim/vim, Subscribed

@k-takata commented on this pull request.


In src/ex_getln.c:

> @@ -1252,7 +1254,7 @@ cmdline_insert_reg(int *gotesc UNUSED)
     redrawcmd();
 
     // The text has been stuffed, the command line didn't change yet.

This comment should be updated, but I'm not sure what is the best explanation.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11960/review/1288671071@github.com>

Bram Moolenaar

unread,
Feb 10, 2023, 4:38:12 PM2/10/23
to vim/vim, Subscribed

Your reproduction steps can be used for a test. It needs to be a screendump test to see the highlighting.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11960/c1426374932@github.com>

Bram Moolenaar

unread,
Feb 10, 2023, 4:39:37 PM2/10/23
to vim/vim, Subscribed

Closed #11960 via c4b7dec.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11960/issue_event/8493974914@github.com>

Reply all
Reply to author
Forward
0 new messages