Skip to content

Commit

Permalink
Implement gui_mch_mousehide to make merging from upstream easier
Browse files Browse the repository at this point in the history
Add an empty implementation to remove a diff from upstream, which
constantly shows up when resolving merge conflicts. We just make the
implementation empty because we already handle mouse hide in the MacVim
process using NSCursor instead, and don't need Vim's manual handling of
it.

Also, refactor test_macvim.vim a little.
  • Loading branch information
ychin committed Mar 15, 2023
1 parent 841c6ab commit 92082eb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/MacVim/gui_macvim.m
Expand Up @@ -1364,6 +1364,15 @@
ASLogInfo(@"Not implemented!");
}

void
gui_mch_mousehide(int hide UNUSED)
{
// We don't implement this. `insertVimStateMessage` already sends this to
// MacVim, and we handle this in the parent process using NSCursor's
// `setHiddenUntilMouseMoves` instead of letting Vim have manual control
// over this.
}


void
mch_set_mouse_shape(int shape)
Expand Down
2 changes: 0 additions & 2 deletions src/option.c
Expand Up @@ -3715,10 +3715,8 @@ did_set_modified(optset_T *args)
char *
did_set_mousehide(optset_T *args UNUSED)
{
# if !defined(FEAT_GUI_MACVIM)
if (!p_mh)
gui_mch_mousehide(FALSE);
# endif
return NULL;
}
#endif
Expand Down
1 change: 1 addition & 0 deletions src/proto/gui_macvim.pro
Expand Up @@ -77,6 +77,7 @@ void gui_mch_set_sp_color(guicolor_T color);
void gui_mch_set_text_area_pos(int x, int y, int w, int h);
void gui_mch_set_winpos(int x, int y);
void gui_mch_setmouse(int x, int y);
void gui_mch_mousehide(int hide);
void gui_mch_settitle(char_u *title, char_u *icon);
void gui_mch_start_blink(void);
void gui_mch_stop_blink(int may_call_gui_update_cursor);
Expand Down
5 changes: 4 additions & 1 deletion src/testdir/test_macvim.vim
Expand Up @@ -6,16 +6,19 @@ CheckFeature gui_macvim
" Tests for basic existence of commands and options to make sure no
" regressions have accidentally removed them
func Test_macvim_options_commands_exist()
" MacVim-specific options
call assert_true(exists('+antialias'), 'Missing option "antialias"')
call assert_true(exists('+blurradius'), 'Missing option "blurradius"')
call assert_true(exists('+fullscreen'), 'Missing option "fullscreen"')
call assert_true(exists('+fuoptions'), 'Missing option "fuoptions"')
call assert_true(exists('+macligatures'), 'Missing option "macligatures"')
call assert_true(exists('+macmeta'), 'Missing option "macmeta"')
call assert_true(exists('+macthinstrokes'), 'Missing option "macthinstrokes"')
call assert_true(exists('+toolbariconsize'), 'Missing option "toolbariconsize"')
call assert_true(exists('+transparency'), 'Missing option "transparency"')

" Other GUI options we care about
call assert_true(exists('+toolbariconsize'), 'Missing option "toolbariconsize"')

call assert_true(exists(':macaction'), 'Missing command "macaction"')
call assert_true(exists(':macmenu'), 'Missing command "macmenu"')

Expand Down

0 comments on commit 92082eb

Please sign in to comment.