Skip to content

Commit b678fcb

Browse files
author
skywind3000
committed
new quickui#tools#input_search()
1 parent 53b5abb commit b678fcb

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

autoload/quickui/tools.vim

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" tools.vim -
44
"
55
" Created by skywind on 2019/12/23
6-
" Last Modified: 2019/12/23 21:22:46
6+
" Last Modified: 2021/11/30 01:33
77
"
88
"======================================================================
99

@@ -487,3 +487,20 @@ function! quickui#tools#terminal(name)
487487
endfunc
488488

489489

490+
"----------------------------------------------------------------------
491+
" search inputbox
492+
"----------------------------------------------------------------------
493+
function! quickui#tools#input_search()
494+
let text = quickui#input#open('Enter text to search:', '', 'search')
495+
redraw
496+
if text == ''
497+
echo "quit search"
498+
return
499+
endif
500+
let text = escape(text, '[\*~^')
501+
" exec '/' . text
502+
call feedkeys("\<ESC>/" . text . "\<cr>", 'n')
503+
endfunc
504+
505+
506+

0 commit comments

Comments
 (0)