Skip to content

Commit 8b78347

Browse files
committed
Nvim: highlight query in prompt as String
1 parent daabf69 commit 8b78347

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

plugin/grepper.vim

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,17 @@ function! s:prompt(flags)
799799
call inputsave()
800800

801801
try
802-
let a:flags.query = input(prompt_text, a:flags.query,
803-
\ 'customlist,grepper#complete_files')
802+
if has('nvim-0.3.4')
803+
let a:flags.query = input({
804+
\ 'prompt': prompt_text,
805+
\ 'default': a:flags.query,
806+
\ 'completion': 'customlist,grepper#complete_files',
807+
\ 'highlight': { cmdline -> [[0, len(cmdline), 'String']] },
808+
\ })
809+
else
810+
let a:flags.query = input(prompt_text, a:flags.query,
811+
\ 'customlist,grepper#complete_files')
812+
endif
804813
catch /^Vim:Interrupt$/ " Ctrl-c was pressed
805814
let s:prompt_op = 'cancelled'
806815
finally

0 commit comments

Comments
 (0)