Skip to content

Commit 706b54d

Browse files
author
skywind3000
committed
Adjust navigator configuration options for minimum and maximum width and height, ensuring min values do not exceed max values, and setting width and height values when popup position is centered.
1 parent 2242333 commit 706b54d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

autoload/navigator/config.vim

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,22 @@ function! navigator#config#init(opts) abort
332332
endif
333333
endif
334334
endif
335+
let opts.min_width = navigator#config#get(opts, 'min_width')
336+
let opts.max_width = navigator#config#get(opts, 'max_width')
337+
let opts.min_height = navigator#config#get(opts, 'min_height')
338+
let opts.max_height = navigator#config#get(opts, 'max_height')
339+
if opts.min_width > opts.max_width
340+
let opts.min_width = opts.max_width
341+
endif
342+
if opts.min_height > opts.max_height
343+
let opts.min_height = opts.max_height
344+
endif
345+
if opts.popup_position == 'center' && opts.popup
346+
let opts.min_width = opts.popup_width
347+
let opts.max_width = opts.popup_width
348+
let opts.min_height = opts.popup_height
349+
let opts.max_height = opts.popup_height
350+
endif
335351
return opts
336352
endfunc
337353

0 commit comments

Comments
 (0)