Skip to content
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

Command bar w/ increased size when in fullscreen and tabs #833

Closed
emaiax opened this issue Jan 10, 2019 · 4 comments · Fixed by #1280
Closed

Command bar w/ increased size when in fullscreen and tabs #833

emaiax opened this issue Jan 10, 2019 · 4 comments · Fixed by #1280
Labels
Renderer Text rendering issues, including CoreText renderer
Milestone

Comments

@emaiax
Copy link

emaiax commented Jan 10, 2019

Using MacVim Snapshot >151 breaks the size of command bar when using tabs.

Prefer native full-screen support, makes no difference here, I tested w/ both options.
I'm using dark mode, but makes no difference either.

Mojave 10.14.2 (18C54)

:version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Dec 13 2018 08:58:43)
macOS version
Included patches: 1-577
Compiled by _datadetectors@Traviss-Mac-6.local
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               +clipboard         +dnd               +fullscreen        +listcmds          -mouse_sysmouse    +postscript        +statusline        +title             +windows
+arabic            +cmdline_compl     -ebcdic            -gettext           +localmap          +mouse_urxvt       +printer           -sun_workshop      +toolbar           +writebackup
+autocmd           +cmdline_hist      +emacs_tags        -hangul_input      +lua/dyn           +mouse_xterm       +profile           +syntax            +transparency      -X11
+autochdir         +cmdline_info      +eval              +iconv             +menu              +multi_byte        +python/dyn        +tag_binary        +user_commands     -xfontset
-autoservername    +comments          +ex_extra          +insert_expand     +mksession         +multi_lang        +python3/dyn       +tag_old_static    +vartabs           +xim
+balloon_eval      +conceal           +extra_search      +job               +modify_fname      -mzscheme          +quickfix          -tag_any_white     +vertsplit         -xpm
+balloon_eval_term +cryptv            +farsi             +jumplist          +mouse             +netbeans_intg     +reltime           -tcl               +virtualedit       -xsmp
+browse            +cscope            +file_in_path      +keymap            +mouseshape        +num64             +rightleft         +termguicolors     +visual            -xterm_clipboard
++builtin_terms    +cursorbind        +find_in_path      +lambda            +mouse_dec         +odbeditor         +ruby/dyn          +terminal          +visualextra       -xterm_save
+byte_offset       +cursorshape       +float             +langmap           -mouse_gpm         +packages          +scrollbind        +terminfo          +viminfo
+channel           +dialog_con_gui    +folding           +libcall           -mouse_jsbterm     +path_extra        +signs             +termresponse      +vreplace
+cindent           +diff              -footer            +linebreak         +mouse_netterm     +perl/dyn          +smartindent       +textobjects       +wildignore
+clientserver      +digraphs          +fork()            +lispindent        +mouse_sgr         +persistent_undo   +startuptime       +timers            +wildmenu
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libya
ml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework AppKit   -fstack-protector  -L/System/L
ibrary/Perl/5.18/darwin-thread-multi-2level/CORE 

Screenshots

Snapshot 151

screenshot 2019-01-10 14 40 47

screenshot 2019-01-10 12 33 59

Snapshot >152

screenshot 2019-01-10 12 39 50

screenshot 2019-01-10 12 40 22

@ychin
Copy link
Member

ychin commented Jan 10, 2019

This is not really a bug per se and is as designed.

When in full screen the screen size is usually not a precise fit for how many number of lines you want to fit (depending on font size). In the snapshot 151 screenshot above you can see that there are black bars and that the tabs are not top-aligned. In 152 it is fixed so that you don’t see black bars (instead the background is filled with background color, read the release notes for it) and that MacVim is always top aligned so the tabs would look right. This does mean the command line is moved up a little bit.

No matter what choice you make in terms of alignment (center or top aligned, black bars or filled with background color) it’s going to look a little weird so it’s just one of those decisions we have to make.

If yoh open GVim on Windows or Linux (GTK) you would actually see similar results when you maximize the window (the command line is not flushed against the bottom).

This is also similar to set guioptions+=k.

@emaiax
Copy link
Author

emaiax commented Jan 17, 2019

@ychin so, I'll close this issue since it isn't an exactly MacVim bug.

Thanks for your answer! ;)

@emaiax emaiax closed this as completed Jan 17, 2019
@ychin ychin added the Renderer Text rendering issues, including CoreText renderer label Dec 25, 2020
@ychin ychin added this to the Backlog milestone Dec 25, 2020
@ychin
Copy link
Member

ychin commented Dec 25, 2020

Re-opening issue. With the recent stateful renderer change (#858), we could introduce a new setting to pin the command line to the bottom. I have some work-in-progress experiments on that but not ready for prime time yet, but using this issue to track.

@ychin ychin reopened this Dec 25, 2020
@ychin ychin modified the milestones: Backlog, snapshot-170 Dec 28, 2020
@ychin ychin modified the milestones: snapshot-170, snapshot-171 Mar 1, 2021
@ychin ychin modified the milestones: snapshot-171, snapshot-172 Apr 1, 2021
ychin added a commit to ychin/macvim that referenced this issue Sep 11, 2022
Add a setting that could pin the command-line portion of Vim to the
bottom of the MacVim window. This is useful when smooth resizing is set,
guioption+=k, or in full screen. In those situations, the MacVim window
size is usually not direct multiples of the Vim text sizes. Previously
the command-line would be drawn like other texts, and hence not aligned
to the bottom and hence looking aesthetically a little off.

When this setting is set, the command-line portion would be aligned to
the bottom of the window. This essentially moves the gap (due to the
extra height of the window) from the bottom to be between cmdline and
the rest of Vim. When cmdheight is changed, or other situations (e.g.
typing too much cmdline height to be increased), the gap will be
adjusted as well.

Implementation-wise, this was done by passing the `commandline_row` var
from Vim to MacVim, which serves as a good estimate of where the
command-line is. This works better than just using the `cmdheight`
option as it is closer to the current state of the cmdline. One issue is
that in hit-enter prompts, the row is set to the 2nd to last row to
anticipate more messages, and we just add a big hack by incrementing the
row by 1 in hit-enter state so only the "Press Enter..." part is aligned
to bottom. We also have to do something similar to when it's showing
"--more--" for similar reasons.

- An alternative would have been to modify Vim to provide us the
  information we want (the number of rows below the status line) but
  it's pretty tricky to do as cmdline_row is used in lots of places.
  It's easier / simpler to do a simple hack like this to localize the
  damage.

Close macvim-dev#833
@ychin
Copy link
Member

ychin commented Sep 11, 2022

There is now a pull request (#1280) up to fix this, sort of. A new setting will now allow you to pin the command line (this is the proper name for the "command bar" as mentioned in this issue) to the bottom of the window. See the PR itself for screenshots and explanations.

ychin added a commit to ychin/macvim that referenced this issue Sep 11, 2022
Add a setting that could pin the command-line portion of Vim to the
bottom of the MacVim window. This is useful when smooth resizing is set,
guioption+=k, or in full screen. In those situations, the MacVim window
size is usually not direct multiples of the Vim text sizes. Previously
the command-line would be drawn like other texts, and hence not aligned
to the bottom and hence looking aesthetically a little off.

When this setting is set, the command-line portion would be aligned to
the bottom of the window. This essentially moves the gap (due to the
extra height of the window) from the bottom to be between cmdline and
the rest of Vim. When cmdheight is changed, or other situations (e.g.
typing too much cmdline height to be increased), the gap will be
adjusted as well.

Implementation-wise, this was done by passing the `commandline_row` var
from Vim to MacVim, which serves as a good estimate of where the
command-line is. This works better than just using the `cmdheight`
option as it is closer to the current state of the cmdline. One issue is
that in hit-enter prompts, the row is set to the 2nd to last row to
anticipate more messages, and we just add a big hack by incrementing the
row by 1 in hit-enter state so only the "Press Enter..." part is aligned
to bottom. We also have to do something similar to when it's showing
"--more--" for similar reasons.

- An alternative would have been to modify Vim to provide us the
  information we want (the number of rows below the status line) but
  it's pretty tricky to do as cmdline_row is used in lots of places.
  It's easier / simpler to do a simple hack like this to localize the
  damage.

Close macvim-dev#833
ychin added a commit to ychin/macvim that referenced this issue Sep 12, 2022
Add a setting that could pin the command-line portion of Vim to the
bottom of the MacVim window. This is useful when smooth resizing is set,
guioption+=k, or in full screen. In those situations, the MacVim window
size is usually not direct multiples of the Vim text sizes. Previously
the command-line would be drawn like other texts, and hence not aligned
to the bottom and hence looking aesthetically a little off.

When this setting is set, the command-line portion would be aligned to
the bottom of the window. This essentially moves the gap (due to the
extra height of the window) from the bottom to be between cmdline and
the rest of Vim. When cmdheight is changed, or other situations (e.g.
typing too much cmdline height to be increased), the gap will be
adjusted as well.

Implementation-wise, this was done by passing the `commandline_row` var
from Vim to MacVim, which serves as a good estimate of where the
command-line is. This works better than just using the `cmdheight`
option as it is closer to the current state of the cmdline. One issue is
that in hit-enter prompts, the row is set to the 2nd to last row to
anticipate more messages, and we just add a big hack by incrementing the
row by 1 in hit-enter state so only the "Press Enter..." part is aligned
to bottom. We also have to do something similar to when it's showing
"--more--" for similar reasons.

- An alternative would have been to modify Vim to provide us the
  information we want (the number of rows below the status line) but
  it's pretty tricky to do as cmdline_row is used in lots of places.
  It's easier / simpler to do a simple hack like this to localize the
  damage.

Close macvim-dev#833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Renderer Text rendering issues, including CoreText renderer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants