Skip to content

Commit 55ec22c

Browse files
committed
option to configure width
1 parent 37423a8 commit 55ec22c

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

autoload/elevator.vim

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ vim9script noclear
44
if !exists('g:elevator#timeout_msec')
55
g:elevator#timeout_msec = 2000
66
endif
7+
if !exists('g:elevator#width')
8+
g:elevator#width = 1
9+
endif
710

811
var s_state = {
912
scrolloff: -1,
@@ -56,12 +59,10 @@ export def Show(winid__a: number)
5659
if s_state.popup_id == -1
5760
s_state.popup_id = popup_create('', {
5861
pos: 'topleft',
59-
minwidth: 1,
62+
minwidth: g:elevator#width,
6063
dragall: true,
61-
resize: true,
6264
zindex: 1,
6365
})
64-
6566
endif
6667

6768
S__set_geometry()
@@ -98,7 +99,7 @@ export def S__set_geometry()
9899
var popup_offset = S__clamp(((wininfo.topline - 1) * scale)->round()->float2nr(), 0, wininfo.height - popup_height)
99100

100101
popup_setoptions(s_state.popup_id, {
101-
col: wininfo.wincol + wininfo.width - 1,
102+
col: wininfo.wincol + wininfo.width - g:elevator#width,
102103
line: wininfo.winrow + wininfo.winbar + popup_offset,
103104
minheight: popup_height,
104105
})

doc/elevator.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Author: Sergey Vlasov <sergey@vlasov.me>
44
Licence: Vim licence, see |license|
55
Site: https://github.com/noscript/elevator.vim
6-
Version: 0.1
6+
Version: 0.2
77

88
================================================================================
99
CONTENTS *elevator-contents*
@@ -33,3 +33,10 @@ Example:
3333
>
3434
g:elevator#timeout_msec = 1000
3535
<
36+
37+
*g:elevator#width* Scrollbar width.
38+
Default value: 1
39+
Example:
40+
>
41+
g:elevator#width = 2
42+
<

0 commit comments

Comments
 (0)