Use match window opts to set initial window height#681
Open
mmrwoods wants to merge 1 commit intokien:masterfrom
mmrwoods:master
Open
Use match window opts to set initial window height#681mmrwoods wants to merge 1 commit intokien:masterfrom mmrwoods:master
mmrwoods wants to merge 1 commit intokien:masterfrom
mmrwoods:master
Conversation
Use the min height of the match window as the initial height of the ControlP window, rather than always using 1 as the starting height. This is primarily to workaround MacVim rendering glitches triggered by automagic resizing of windows when in non-native fullscreen mode, and core text renderer is enabled, but doesn't seem an unreasonable default. When MacVim is running in non-native fullscreen mode with core text renderer enabled, automatically resizing windows causes some parts of the screen to become blacked out. This is a known issue with MacVim... http://vim.1045645.n5.nabble.com/Trouble-with-the-Core-Text-renderer-in-non-native-full-screen-td5713348.html Allowing the ControlP window to open with a fixed height, by setting the min and max match window height to the same value, makes it trivial to work around the rendering glitches using the g:ctrlp_buffer_func option to clear and redraw the screen when exiting the ControlP buffer, e.g. " Clear and redraw screen when exiting CtrlP buffer let g:ctrlp_buffer_func = { \ 'exit': 'RedrawScreen', \ } function RedrawScreen() exec 'redraw!' endfunction Before this change, the only solution I could find to the need to redraw after the ControlP window was resized to match window min height was a fugly CursorMoved autocmd to redraw the screen the first time the cursor moves inside the ControlP window, e.g. " Fix the dimensions of the CtrlP window to avoid dynamic resizing let g:ctrlp_match_window = 'bottom,order:btt,min:10,max:10,results:10' " Redraw screen when CtrlP window is resized after scanning for files " This is only necessary because CtrlP doesn't open the window using " the dimensions set above, but resizes *after* scanning for files. autocmd CursorMoved ControlP \ if !exists('b:ctrlp_did_redraw') | \ exec 'redraw!' | \ let b:ctrlp_did_redraw = 1 | \ endif This commit allows me to remove that fugly CursorMoved autocmd, which makes me super happy :-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use the min height of the match window as the initial height of the
ControlP window, rather than always using 1 as the starting height.
This is primarily to workaround MacVim rendering glitches triggered by
automagic resizing of windows when in non-native fullscreen mode, and
core text renderer is enabled, but doesn't seem an unreasonable default.
When MacVim is running in non-native fullscreen mode with core text
renderer enabled, automatically resizing windows causes some parts of
the screen to become blacked out. This is a known issue with MacVim...
http://vim.1045645.n5.nabble.com/Trouble-with-the-Core-Text-renderer-in-non-native-full-screen-td5713348.html
Allowing the ControlP window to open with a fixed height, by setting the
min and max match window height to the same value, makes it trivial to
work around the rendering glitches using the g:ctrlp_buffer_func option
to clear and redraw the screen when exiting the ControlP buffer, e.g.
Before this change, the only solution I could find to the need to redraw
after the ControlP window was resized to match window min height was a
fugly CursorMoved autocmd to redraw the screen the first time the cursor
moves inside the ControlP window, e.g.
This commit allows me to remove that fugly CursorMoved autocmd, which
makes me super happy :-)