Skip to content

Commit 4c6ff12

Browse files
author
skywind3000
committed
optimize default listbox position
1 parent e9a6f89 commit 4c6ff12

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

autoload/quickui/listbox.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" listbox.vim -
44
"
55
" Created by skywind on 2019/12/20
6-
" Last Modified: 2020/02/20 02:00
6+
" Last Modified: 2023/08/30 14:47
77
"
88
"======================================================================
99

@@ -486,10 +486,11 @@ function! s:nvim_create_listbox(textlist, opts)
486486
else
487487
let limit1 = (&lines - 2) * 90 / 100
488488
let limit2 = (&lines - 2)
489+
" echom printf("limit1=%d limit2=%d h=%d hh=%d", limit1, limit2, h, hh)
489490
if h + 4 < limit1
490-
let opts.row = (limit1 - hh) / 2 - 1
491+
let opts.row = (limit1 - hh) / 2
491492
else
492-
let opts.row = (limit2 - hh) / 2 - 1
493+
let opts.row = (limit2 - hh) / 2
493494
endif
494495
let opts.row = (opts.row < 0)? 0 : opts.row
495496
endif

0 commit comments

Comments
 (0)