Skip to content

Commit

Permalink
option to configure width
Browse files Browse the repository at this point in the history
  • Loading branch information
noscript committed Aug 21, 2023
1 parent 37423a8 commit 55ec22c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 5 additions & 4 deletions autoload/elevator.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ vim9script noclear
if !exists('g:elevator#timeout_msec')
g:elevator#timeout_msec = 2000
endif
if !exists('g:elevator#width')
g:elevator#width = 1
endif

var s_state = {
scrolloff: -1,
Expand Down Expand Up @@ -56,12 +59,10 @@ export def Show(winid__a: number)
if s_state.popup_id == -1
s_state.popup_id = popup_create('', {
pos: 'topleft',
minwidth: 1,
minwidth: g:elevator#width,
dragall: true,
resize: true,
zindex: 1,
})

endif

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

popup_setoptions(s_state.popup_id, {
col: wininfo.wincol + wininfo.width - 1,
col: wininfo.wincol + wininfo.width - g:elevator#width,
line: wininfo.winrow + wininfo.winbar + popup_offset,
minheight: popup_height,
})
Expand Down
9 changes: 8 additions & 1 deletion doc/elevator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Author: Sergey Vlasov <sergey@vlasov.me>
Licence: Vim licence, see |license|
Site: https://github.com/noscript/elevator.vim
Version: 0.1
Version: 0.2

================================================================================
CONTENTS *elevator-contents*
Expand Down Expand Up @@ -33,3 +33,10 @@ Example:
>
g:elevator#timeout_msec = 1000
<

*g:elevator#width* Scrollbar width.
Default value: 1
Example:
>
g:elevator#width = 2
<

0 comments on commit 55ec22c

Please sign in to comment.