Skip to content

Commit c9b378e

Browse files
authored
Merge pull request #309 from macvim-dev/fix/evalfunc
Re-merge evalfunc.c
2 parents c8da80e + a70eb57 commit c9b378e

1 file changed

Lines changed: 35 additions & 8 deletions

File tree

src/evalfunc.c

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4036,7 +4036,14 @@ f_getchar(typval_T *argvars, typval_T *rettv)
40364036
rettv->vval.v_string = vim_strsave(temp);
40374037

40384038
#ifdef FEAT_MOUSE
4039-
if (is_mouse_key(n))
4039+
if (is_mouse_key(n)
4040+
# ifdef FEAT_GUI_MACVIM
4041+
|| n == K_SWIPELEFT
4042+
|| n == K_SWIPERIGHT
4043+
|| n == K_SWIPEUP
4044+
|| n == K_SWIPEDOWN
4045+
# endif
4046+
)
40404047
{
40414048
int row = mouse_row;
40424049
int col = mouse_col;
@@ -5140,6 +5147,9 @@ f_has(typval_T *argvars, typval_T *rettv)
51405147
#if !defined(USE_SYSTEM) && defined(UNIX)
51415148
"fork",
51425149
#endif
5150+
#ifdef FEAT_FULLSCREEN
5151+
"fullscreen",
5152+
#endif
51435153
#ifdef FEAT_GETTEXT
51445154
"gettext",
51455155
#endif
@@ -5167,6 +5177,9 @@ f_has(typval_T *argvars, typval_T *rettv)
51675177
#ifdef FEAT_GUI_MAC
51685178
"gui_mac",
51695179
#endif
5180+
#ifdef FEAT_GUI_MACVIM
5181+
"gui_macvim",
5182+
#endif
51705183
#ifdef FEAT_GUI_MOTIF
51715184
"gui_motif",
51725185
#endif
@@ -5349,6 +5362,9 @@ f_has(typval_T *argvars, typval_T *rettv)
53495362
#ifdef FEAT_NETBEANS_INTG
53505363
"netbeans_intg",
53515364
#endif
5365+
#ifdef FEAT_ODB_EDITOR
5366+
"odbeditor",
5367+
#endif
53525368
#ifdef FEAT_SPELL
53535369
"spell",
53545370
#endif
@@ -5396,6 +5412,9 @@ f_has(typval_T *argvars, typval_T *rettv)
53965412
#ifdef FEAT_TOOLBAR
53975413
"toolbar",
53985414
#endif
5415+
#ifdef FEAT_TRANSPARENCY
5416+
"transparency",
5417+
#endif
53995418
#if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
54005419
"unnamedplus",
54015420
#endif
@@ -7998,8 +8017,10 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr)
79988017
char_u buf[NUMBUFLEN];
79998018
# ifdef WIN32
80008019
HWND w;
8001-
# else
8020+
# elif defined(FEAT_X11)
80028021
Window w;
8022+
# elif defined(MAC_CLIENTSERVER)
8023+
int w; // This is the port number ('w' is a bit confusing)
80038024
# endif
80048025

80058026
if (check_restricted() || check_secure())
@@ -8016,9 +8037,11 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr)
80168037
keys = get_tv_string_buf(&argvars[1], buf);
80178038
# ifdef WIN32
80188039
if (serverSendToVim(server_name, keys, &r, &w, expr, TRUE) < 0)
8019-
# else
8040+
# elif defined(FEAT_X11)
80208041
if (serverSendToVim(X_DISPLAY, server_name, keys, &r, &w, expr, 0, TRUE)
80218042
< 0)
8043+
# elif defined(MAC_CLIENTSERVER)
8044+
if (serverSendToVim(server_name, keys, &r, &w, expr, TRUE) < 0)
80228045
# endif
80238046
{
80248047
if (r != NULL)
@@ -8075,7 +8098,7 @@ f_remote_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
80758098
if (server_name != NULL)
80768099
serverForeground(server_name);
80778100
}
8078-
# else
8101+
# elif defined(FEAT_X11) || defined(MAC_CLIENTSERVER)
80798102
/* Send a foreground() expression to the server. */
80808103
argvars[1].v_type = VAR_STRING;
80818104
argvars[1].vval.v_string = vim_strsave((char_u *)"foreground()");
@@ -8117,12 +8140,14 @@ f_remote_peek(typval_T *argvars UNUSED, typval_T *rettv)
81178140
s = serverGetReply((HWND)n, FALSE, FALSE, FALSE);
81188141
rettv->vval.v_number = (s != NULL);
81198142
}
8120-
# else
8143+
# elif defined(FEAT_X11)
81218144
if (check_connection() == FAIL)
81228145
return;
81238146

81248147
rettv->vval.v_number = serverPeekReply(X_DISPLAY,
81258148
serverStrToWin(serverid), &s);
8149+
# elif defined(MAC_CLIENTSERVER)
8150+
rettv->vval.v_number = serverPeekReply(serverStrToPort(serverid), &s);
81268151
# endif
81278152

81288153
if (argvars[1].v_type != VAR_UNKNOWN && rettv->vval.v_number > 0)
@@ -8159,9 +8184,11 @@ f_remote_read(typval_T *argvars UNUSED, typval_T *rettv)
81598184
if (n != 0)
81608185
r = serverGetReply((HWND)n, FALSE, TRUE, TRUE);
81618186
if (r == NULL)
8162-
# else
8187+
# elif defined(FEAT_X11)
81638188
if (check_connection() == FAIL || serverReadReply(X_DISPLAY,
81648189
serverStrToWin(serverid), &r, FALSE) < 0)
8190+
# elif defined(MAC_CLIENTSERVER)
8191+
if (serverReadReply(serverStrToPort(serverid), &r) < 0)
81658192
# endif
81668193
EMSG(_("E277: Unable to read a server reply"));
81678194
}
@@ -9209,9 +9236,9 @@ f_serverlist(typval_T *argvars UNUSED, typval_T *rettv)
92099236
char_u *r = NULL;
92109237

92119238
#ifdef FEAT_CLIENTSERVER
9212-
# ifdef WIN32
9239+
# if defined(WIN32) || defined(MAC_CLIENTSERVER)
92139240
r = serverGetVimNames();
9214-
# else
9241+
# elif defined(FEAT_X11)
92159242
make_connection();
92169243
if (X_DISPLAY != NULL)
92179244
r = serverGetVimNames(X_DISPLAY);

0 commit comments

Comments
 (0)