patch 9.0.1298: inserting register on the cmdline does not trigger incsearch

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)
diff --git a/src/testdir/test_hlsearch.vim b/src/testdir/test_hlsearch.vim
index 4227dbd..476c075 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 @@
   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