Skip to content

Commit

Permalink
update nohl
Browse files Browse the repository at this point in the history
  • Loading branch information
skywind3000 committed Nov 29, 2021
1 parent b2614a7 commit 6632a2f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions autoload/quickui/input.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
" input.vim -
"
" Created by skywind on 2021/11/27
" Last Modified: 2021/11/30 00:49
" Last Modified: 2021/11/30 01:50
"
"======================================================================

Expand Down Expand Up @@ -33,7 +33,11 @@ function! s:init_input_box(prompt, opts)
if has_key(a:opts, 'w')
let hwnd.w = a:opts.w
else
let limit = strdisplaywidth(a:prompt)
let limit = 8
for text in head
let width = strdisplaywidth(text)
let limit = (limit < width)? width : limit
endfor
if &columns >= 80
let limit = (limit < 50)? 50 : limit
endif
Expand Down Expand Up @@ -237,6 +241,7 @@ function! quickui#input#create(prompt, opts)
let rl = hwnd.rl
let accept = 0
let result = ''
silent! exec 'nohl'
while hwnd.exit == 0
call s:update_input(hwnd)
try
Expand Down
8 changes: 5 additions & 3 deletions autoload/quickui/tools.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
" tools.vim -
"
" Created by skywind on 2019/12/23
" Last Modified: 2021/11/30 01:37
" Last Modified: 2021/11/30 01:42
"
"======================================================================

Expand Down Expand Up @@ -491,8 +491,10 @@ endfunc
" search inputbox
"----------------------------------------------------------------------
function! quickui#tools#input_search()
let t = expand('<cword>')
let text = quickui#input#open('Enter text to search:', t, 'search')
let word = expand('<cword>')
let title = ['Enter text to search']
" let title += [repeat('*', 70)]
let text = quickui#input#open(title, word, 'search')
redraw
if text == ''
echo "quit search"
Expand Down

0 comments on commit 6632a2f

Please sign in to comment.