-
Notifications
You must be signed in to change notification settings - Fork 89
Introduce g:ctrlsf_compact_winsize config variable #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
autoload/ctrlsf/win.vim
Outdated
| " compact mode: fixed window size and position | ||
| let winsize = 10 | ||
| if g:ctrlsf_compact_winsize =~ '\d\{1,2}%' | ||
| let winsize = &lines * str2nr(g:ctrlsf_winsize) / 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using ctrlsf_compact_winsize instead of ctrlsf_winsize makes more sense maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woops, of course!
autoload/ctrlsf/win.vim
Outdated
| if g:ctrlsf_compact_winsize =~ '\d\{1,2}%' | ||
| let winsize = &lines * str2nr(g:ctrlsf_winsize) / 100 | ||
| elseif g:ctrlsf_compact_winsize =~ '\d\+' | ||
| let winsize = str2nr(g:ctrlsf_winsize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double woops!
ab9cc23 to
599922e
Compare
| let g:ctrlsf_toggle_map_key = '\t' | ||
| < | ||
| g:ctrlsf_winsize *'g:ctrlsf_width'* | ||
| g:ctrlsf_winsize *'g:ctrlsf_winsize'* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
doc/ctrlsf.txt
Outdated
| Height of CtrlSF compact window. It accepts string as its value and there are | ||
| 3 types of argument: | ||
| > | ||
| 'auto' : half of current vim window size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not true. The default value is 10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for misleading you.
I think a fixed value 10 (height of vim's builtin qucikfix window) is a sensible default value for g:ctrlsf_compact_winsize. To me, auto seems unnecessary for this option, it's better to remove it from the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did indeed set the default to 10 lines in plugin/ctrlsf.vim. =)
I had the same thought about perhaps removing auto, but I thought I'd keep it to match the options available for g:ctrlsf_winsize. If you would still like for me to remove it then I certainly can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it's not a big deal. Let's merge it.
plugin/ctrlsf.vim
Outdated
| endif | ||
| " }}} | ||
|
|
||
| " g:ctrlsf_winsize {{{2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
ctrlsf.vim/autoload/ctrlsf/preview.vim Lines 40 to 42 in 89a8ec1
Don't miss the code here. The compact window's size is also used to compute the preview window's size. |
The g:ctrlsf_winsize variable only controls the non-compact CtrlSF, therefore a new g:ctrlsf_compact_winsize config is introduced to control the compact window in much the same way.
599922e to
2fe77c2
Compare
|
comments addressed =) |
|
Much appreciated, as always! |
The g:ctrlsf_winsize variable only controls the non-compact CtrlSF,
therefore a new g:ctrlsf_compact_winsize config is introduced to control
the compact window in much the same way.