[vim/vim] Fix incsearch ctrl-g/t (#4664)

36 views
Skip to first unread message

mattn

unread,
Jul 13, 2019, 12:22:41 PM7/13/19
to vim/vim, Subscribed

Insert word on cursor does not work after CTRL-G/T while incsearch.

aAA, 112BBB222, CCC333, DDD, EEE
aaa, 111bbb222, ccc333, ddd, eee

set incsearch and type /ddd<C-G><C-R><C-W>. My expected result is /dddeee but insert word does not work since cursor location is not at end of match.

screenshot1

This fix move the corsor-want to the end of match.


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

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

Commit Summary

  • Correct cursor location after Ctrl_G/Ctrl_T while incsearch
  • Add test

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

mattn

unread,
Jul 13, 2019, 12:24:26 PM7/13/19
to vim/vim, Subscribed

@mattn commented on this pull request.


In src/os_win32.c:

> @@ -3713,7 +3713,12 @@ ResizeWindow(
     HANDLE     hConsole,
     SMALL_RECT srWindowRect)
 {
-    if (!SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect))
+    {
+	FILE* fp = fopen("testtest.log", "a");
+	fprintf(fp, "%d,%d,%d,%d\n", srWindowRect.Left, srWindowRect.Right, srWindowRect.Top, srWindowRect.Bottom);

Sorry. I'll remove this.

mattn

unread,
Jul 13, 2019, 8:43:23 PM7/13/19
to vim/vim, Subscribed

Is this test expected?

func Test_search_cmdline5()
  if !exists('+incsearch')
    return
  endif
  " Do not call test_override("char_avail", 1) so that <C-g> and <C-t> work
  " regardless char_avail.
  new
  call setline(1, ['  1 the first', '  2 the second', '  3 the third'])
  set incsearch
  1
  call feedkeys("/the\<c-g>\<c-g>\<cr>", 'tx')
  call assert_equal('  3 the third', getline('.'))
  $
  call feedkeys("?the\<c-t>\<c-t>\<c-t>\<cr>", 'tx')
  call assert_equal('  2 the second', getline('.'))
  " clean up
  set noincsearch
  bw!
endfunc

Bram Moolenaar

unread,
Jul 14, 2019, 9:26:57 AM7/14/19
to vim/vim, Subscribed

Strange that the test passes on Travis but fails on Appveyor.

mattn

unread,
Jul 16, 2019, 9:20:18 AM7/16/19
to vim/vim, Push

@mattn pushed 3 commits.

  • f12f38a Merge branch 'master' into fix-incsearch-ctrl-t
  • 958f57f Merge branch 'master' into fix-incsearch-ctrl-t
  • fd9c30b Fix test


You are receiving this because you are subscribed to this thread.

View it on GitHub

mattn

unread,
Jul 16, 2019, 9:25:21 AM7/16/19
to vim/vim, Subscribed

I think the test was wrong since $ goes first letter of third line. So typing <c-t> twice should goes 2 the second.

mattn

unread,
Jul 16, 2019, 9:42:13 AM7/16/19
to vim/vim, Push

@mattn pushed 1 commit.

  • e4b8219 Typing CTRL-T twice should goes "1 the first"


You are receiving this because you are subscribed to this thread.

View it on GitHub

mattn

unread,
Jul 16, 2019, 9:46:39 AM7/16/19
to vim/vim, Subscribed

Probably, wrapscan is enabled on appveyor.

Codecov

unread,
Jul 16, 2019, 10:05:22 AM7/16/19
to vim/vim, Subscribed

Codecov Report

Merging #4664 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@

##           master    #4664      +/-   ##

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

+ Coverage   81.33%   81.36%   +0.02%     

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

  Files         110      114       +4     

  Lines      144866   145131     +265     

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

+ Hits       117832   118085     +253     

- Misses      27034    27046      +12
Impacted Files Coverage Δ
src/ex_getln.c 76.7% <100%> (ø) ⬆️
src/ex_cmds.c 82.18% <0%> (-0.25%) ⬇️
src/os_unix.c 63.35% <0%> (-0.18%) ⬇️
src/window.c 87.33% <0%> (-0.07%) ⬇️
src/gui_gtk_x11.c 57.91% <0%> (-0.05%) ⬇️
src/json_test.c 100% <0%> (ø)
src/memfile_test.c 100% <0%> (ø)
src/kword_test.c 66.66% <0%> (ø)
src/message_test.c 100% <0%> (ø)
src/term.c 79.16% <0%> (+0.05%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 250e311...e4b8219. Read the comment docs.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or mute the thread.

Bram Moolenaar

unread,
Jul 16, 2019, 3:39:41 PM7/16/19
to vim/vim, Subscribed

Closed #4664 via 69a5b86.

Reply all
Reply to author
Forward
0 new messages