Skip to content

Conversation

@shanesmith
Copy link
Contributor

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.

" 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
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops, of course!

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)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double woops!

let g:ctrlsf_toggle_map_key = '\t'
<
g:ctrlsf_winsize *'g:ctrlsf_width'*
g:ctrlsf_winsize *'g:ctrlsf_winsize'*
Copy link
Owner

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.
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Owner

@dyng dyng Dec 18, 2020

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.

Copy link
Contributor Author

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.

Copy link
Owner

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.

endif
" }}}

" g:ctrlsf_winsize {{{2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@dyng
Copy link
Owner

dyng commented Dec 16, 2020

" compact mode
let winsize = &lines - 20
let openpos = 'leftabove'

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.
@shanesmith
Copy link
Contributor Author

comments addressed =)

@dyng dyng merged commit fbb0242 into dyng:master Dec 19, 2020
@shanesmith
Copy link
Contributor Author

Much appreciated, as always!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants