summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorK.Takata <kentkt@csc.jp>2023-02-10 21:38:44 +0000
committerBram Moolenaar <Bram@vim.org>2023-02-10 21:38:44 +0000
commitc4b7dec38292fe1cfad7aa5f244031fc6f7c7a09 (patch)
treeba46891cd829d6d5ebd640ea74e51b7ef1528190 /src/testdir
parent962d91643520ec3748fcf5af3263d89ccfcdda92 (diff)
patch 9.0.1298: inserting register on the cmdline does not trigger incsearchv9.0.1298
Problem: Inserting a register on the command line does not trigger incsearch or update hlsearch. Solution: Have cmdline_insert_reg() return CMDLINE_CHANGED when appropriate and handle it correctly. (Ken Takata, closes #11960)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/dumps/Test_hlsearch_ctrlr_1.dump6
-rw-r--r--src/testdir/test_hlsearch.vim19
2 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_hlsearch_ctrlr_1.dump b/src/testdir/dumps/Test_hlsearch_ctrlr_1.dump
new file mode 100644
index 0000000000..e0a0af3aa6
--- /dev/null
+++ b/src/testdir/dumps/Test_hlsearch_ctrlr_1.dump
@@ -0,0 +1,6 @@
+| +0&#ffffff0@59
+|t+1&&|e|x|t| +0&&@55
+|~+0#4040ff13&| @58
+|~| @58
+|~| @58
+|/+0#0000000&|t|e|x|t> @54
diff --git a/src/testdir/test_hlsearch.vim b/src/testdir/test_hlsearch.vim
index 4227dbd6d5..476c075a5d 100644
--- a/src/testdir/test_hlsearch.vim
+++ b/src/testdir/test_hlsearch.vim
@@ -1,6 +1,7 @@
" Test for v:hlsearch
source check.vim
+source screendump.vim
func Test_hlsearch()
new
@@ -72,4 +73,22 @@ func Test_hlsearch_eol_highlight()
bwipe!
endfunc
+func Test_hlsearch_Ctrl_R()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ set incsearch hlsearch
+ let @" = "text"
+ put
+ END
+ call writefile(lines, 'XhlsearchCtrlR', 'D')
+ let buf = RunVimInTerminal('-S XhlsearchCtrlR', #{rows: 6, cols: 60})
+
+ call term_sendkeys(buf, "/\<C-R>\<C-R>\"")
+ call VerifyScreenDump(buf, 'Test_hlsearch_ctrlr_1', {})
+
+ call term_sendkeys(buf, "\<Esc>")
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab