Skip to content

Commit 92082eb

Browse files
committed
Implement gui_mch_mousehide to make merging from upstream easier
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.
1 parent 841c6ab commit 92082eb

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

src/MacVim/gui_macvim.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,15 @@
13641364
ASLogInfo(@"Not implemented!");
13651365
}
13661366

1367+
void
1368+
gui_mch_mousehide(int hide UNUSED)
1369+
{
1370+
// We don't implement this. `insertVimStateMessage` already sends this to
1371+
// MacVim, and we handle this in the parent process using NSCursor's
1372+
// `setHiddenUntilMouseMoves` instead of letting Vim have manual control
1373+
// over this.
1374+
}
1375+
13671376

13681377
void
13691378
mch_set_mouse_shape(int shape)

src/option.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3715,10 +3715,8 @@ did_set_modified(optset_T *args)
37153715
char *
37163716
did_set_mousehide(optset_T *args UNUSED)
37173717
{
3718-
# if !defined(FEAT_GUI_MACVIM)
37193718
if (!p_mh)
37203719
gui_mch_mousehide(FALSE);
3721-
# endif
37223720
return NULL;
37233721
}
37243722
#endif

src/proto/gui_macvim.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ void gui_mch_set_sp_color(guicolor_T color);
7777
void gui_mch_set_text_area_pos(int x, int y, int w, int h);
7878
void gui_mch_set_winpos(int x, int y);
7979
void gui_mch_setmouse(int x, int y);
80+
void gui_mch_mousehide(int hide);
8081
void gui_mch_settitle(char_u *title, char_u *icon);
8182
void gui_mch_start_blink(void);
8283
void gui_mch_stop_blink(int may_call_gui_update_cursor);

src/testdir/test_macvim.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ CheckFeature gui_macvim
66
" Tests for basic existence of commands and options to make sure no
77
" regressions have accidentally removed them
88
func Test_macvim_options_commands_exist()
9+
" MacVim-specific options
910
call assert_true(exists('+antialias'), 'Missing option "antialias"')
1011
call assert_true(exists('+blurradius'), 'Missing option "blurradius"')
1112
call assert_true(exists('+fullscreen'), 'Missing option "fullscreen"')
1213
call assert_true(exists('+fuoptions'), 'Missing option "fuoptions"')
1314
call assert_true(exists('+macligatures'), 'Missing option "macligatures"')
1415
call assert_true(exists('+macmeta'), 'Missing option "macmeta"')
1516
call assert_true(exists('+macthinstrokes'), 'Missing option "macthinstrokes"')
16-
call assert_true(exists('+toolbariconsize'), 'Missing option "toolbariconsize"')
1717
call assert_true(exists('+transparency'), 'Missing option "transparency"')
1818

19+
" Other GUI options we care about
20+
call assert_true(exists('+toolbariconsize'), 'Missing option "toolbariconsize"')
21+
1922
call assert_true(exists(':macaction'), 'Missing command "macaction"')
2023
call assert_true(exists(':macmenu'), 'Missing command "macmenu"')
2124

0 commit comments

Comments
 (0)