Skip to content

Commit 6632a2f

Browse files
author
skywind3000
committed
update nohl
1 parent b2614a7 commit 6632a2f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

autoload/quickui/input.vim

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" input.vim -
44
"
55
" Created by skywind on 2021/11/27
6-
" Last Modified: 2021/11/30 00:49
6+
" Last Modified: 2021/11/30 01:50
77
"
88
"======================================================================
99

@@ -33,7 +33,11 @@ function! s:init_input_box(prompt, opts)
3333
if has_key(a:opts, 'w')
3434
let hwnd.w = a:opts.w
3535
else
36-
let limit = strdisplaywidth(a:prompt)
36+
let limit = 8
37+
for text in head
38+
let width = strdisplaywidth(text)
39+
let limit = (limit < width)? width : limit
40+
endfor
3741
if &columns >= 80
3842
let limit = (limit < 50)? 50 : limit
3943
endif
@@ -237,6 +241,7 @@ function! quickui#input#create(prompt, opts)
237241
let rl = hwnd.rl
238242
let accept = 0
239243
let result = ''
244+
silent! exec 'nohl'
240245
while hwnd.exit == 0
241246
call s:update_input(hwnd)
242247
try

autoload/quickui/tools.vim

Lines changed: 5 additions & 3 deletions
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: 2021/11/30 01:37
6+
" Last Modified: 2021/11/30 01:42
77
"
88
"======================================================================
99

@@ -491,8 +491,10 @@ endfunc
491491
" search inputbox
492492
"----------------------------------------------------------------------
493493
function! quickui#tools#input_search()
494-
let t = expand('<cword>')
495-
let text = quickui#input#open('Enter text to search:', t, 'search')
494+
let word = expand('<cword>')
495+
let title = ['Enter text to search']
496+
" let title += [repeat('*', 70)]
497+
let text = quickui#input#open(title, word, 'search')
496498
redraw
497499
if text == ''
498500
echo "quit search"

0 commit comments

Comments
 (0)