Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/evalvars.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ static struct vimvar
char vv_flags; // VV_COMPAT, VV_RO, VV_RO_SBX
} vimvars[VV_LEN] =
{
// MacVim-specific value go here
// We put this at the beginning using C99 designated initializers to
// reduce merge conflicts.
[VV_OS_APPEARANCE] = {VV_NAME("os_appearance", VAR_NUMBER), NULL, VV_RO},

// The order here must match the VV_ defines in vim.h!
// Initializing a union does not work, leave tv.vval empty to get zero's.
[0] =
{VV_NAME("count", VAR_NUMBER), NULL, VV_COMPAT+VV_RO},
{VV_NAME("count1", VAR_NUMBER), NULL, VV_RO},
{VV_NAME("prevcount", VAR_NUMBER), NULL, VV_RO},
Expand Down Expand Up @@ -169,9 +175,7 @@ static struct vimvar
{VV_NAME("termosc", VAR_STRING), NULL, VV_RO},
{VV_NAME("vim_did_init", VAR_NUMBER), NULL, VV_RO},
{VV_NAME("clipproviders", VAR_DICT), NULL, VV_RO},
{VV_NAME("imagebackend", VAR_STRING), NULL, VV_RO},
// MacVim-specific value go here
{VV_NAME("os_appearance", VAR_NUMBER), NULL, VV_RO},
{VV_NAME("imagebackend", VAR_STRING), NULL, VV_RO}
};

// shorthand
Expand Down
19 changes: 12 additions & 7 deletions src/keymap.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@
*/
enum key_extra
{
// MacVim-specific changes
// We put this at the beginning to reduce merge conflicts. The values
// starting at 210 should be large enough to avoid any overlap with regular
// Vim keys, while giving a stable values for these over different builds.
#ifdef FEAT_GUI_MACVIM
KE_SWIPELEFT = 210, // Swipe trackpad left
KE_SWIPERIGHT, // Swipe trackpad right
KE_SWIPEUP, // Swipe trackpad up
KE_SWIPEDOWN, // Swipe trackpad down
KE_FORCECLICK, // Force click on trackpad
#endif

KE_S_UP = 4 // shift-up
, KE_S_DOWN = 5 // shift-down

Expand Down Expand Up @@ -282,13 +294,6 @@ enum key_extra
, KE_WILD = 108 // triggers wildmode completion
, KE_OSC = 109 // finished OSC sequence
, KE_COMPLETE_DELAY = 110 // 'autocompletedelay' expired
#ifdef FEAT_GUI_MACVIM
, KE_SWIPELEFT = 111 // Swipe trackpad left
, KE_SWIPERIGHT = 112 // Swipe trackpad right
, KE_SWIPEUP = 113 // Swipe trackpad up
, KE_SWIPEDOWN = 114 // Swipe trackpad down
, KE_FORCECLICK = 115 // Force click on trackpad
#endif
};

/*
Expand Down
11 changes: 5 additions & 6 deletions src/proto/evalfunc.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// MacVim only
void f_getcurpos(typval_T *argvars, typval_T *rettv);
void f_getpos(typval_T *argvars, typval_T *rettv);
void f_getregion(typval_T *argvars, typval_T *rettv);

// evalfunc.c
int arg_type_modifiable(type_T *type, int arg_idx);
char_u *get_function_name(expand_T *xp, int idx);
Expand Down Expand Up @@ -29,10 +34,4 @@ void mzscheme_call_vim(char_u *name, typval_T *args, typval_T *rettv);
void range_list_materialize(list_T *list);
long do_searchpair(char_u *spat, char_u *mpat, char_u *epat, int dir, typval_T *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit);
int get_yank_type(char_u **pp, char_u *yank_type, long *block_len);

// MacVim only
void f_getcurpos(typval_T *argvars, typval_T *rettv);
void f_getpos(typval_T *argvars, typval_T *rettv);
void f_getregion(typval_T *argvars, typval_T *rettv);

// vim: ft=c
16 changes: 8 additions & 8 deletions src/proto/gui_xim.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// MacVim
void call_imactivatefunc(int active);
int call_imstatusfunc(void);
void im_preedit_start_macvim(void);
void im_preedit_end_macvim(void);
void im_preedit_abandon_macvim(void);
void im_preedit_changed_macvim(char *preedit_string, int cursor_index);

// gui_xim.c
char *did_set_imactivatefunc(optset_T *args);
char *did_set_imstatusfunc(optset_T *args);
Expand All @@ -18,12 +26,4 @@ int preedit_get_status(void);
int im_is_preediting(void);
void xim_set_status_area(void);
int xim_get_status_area_height(void);

// MacVim
void call_imactivatefunc(int active);
int call_imstatusfunc(void);
void im_preedit_start_macvim(void);
void im_preedit_end_macvim(void);
void im_preedit_abandon_macvim(void);
void im_preedit_changed_macvim(char *preedit_string, int cursor_index);
// vim: ft=c
7 changes: 3 additions & 4 deletions src/proto/mouse.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// MacVim-only
int get_fpos_of_mouse(pos_T *mpos);

// mouse.c
void mouse_set_vert_scroll_step(long step);
void mouse_set_hor_scroll_step(long step);
Expand All @@ -24,8 +27,4 @@ int mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump, int *pline
win_T *mouse_find_win(int *rowp, int *colp, mouse_find_T popup);
int vcol2col(win_T *wp, linenr_T lnum, int vcol, colnr_T *coladdp);
void f_getmousepos(typval_T *argvars, typval_T *rettv);

// MacVim-only
int get_fpos_of_mouse(pos_T *mpos);

// vim: ft=c
7 changes: 3 additions & 4 deletions src/proto/normal.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// MacVim only
void nv_put(cmdarg_T *cap);

// normal.c
int check_text_or_curbuf_locked(oparg_T *oap);
void normal_cmd(oparg_T *oap, int toplevel);
Expand Down Expand Up @@ -34,8 +37,4 @@ void nv_g_home_m_cmd(cmdarg_T *cap);
int unadjust_for_sel(void);
int unadjust_for_sel_inner(pos_T *pp);
void set_cursor_for_append_to_line(void);

// MacVim only
void nv_put(cmdarg_T *cap);

// vim: ft=c
19 changes: 9 additions & 10 deletions src/proto/option.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// MacVim options
char *did_set_antialias(optset_T *args);
char *did_set_blur(optset_T *args);
char *did_set_columnspace(optset_T *args);
char *did_set_fullscreen(optset_T *args);
char *did_set_macligatures(optset_T *args);
char *did_set_macthinstrokes(optset_T *args);
char *did_set_transparency(optset_T *args);

// option.c
void set_init_1(int clean_arg);
void set_fencs_unicode(void);
Expand Down Expand Up @@ -95,16 +104,6 @@ char *did_set_wlsteal(optset_T *args);
char *did_set_wltimeoutlen(optset_T *args);
char *did_set_wrap(optset_T *args);
char *did_set_xhistory(optset_T *args);

// MacVim options
char *did_set_antialias(optset_T *args);
char *did_set_blur(optset_T *args);
char *did_set_columnspace(optset_T *args);
char *did_set_fullscreen(optset_T *args);
char *did_set_macligatures(optset_T *args);
char *did_set_macthinstrokes(optset_T *args);
char *did_set_transparency(optset_T *args);

void check_redraw(long_u flags);
int findoption(char_u *arg);
getoption_T get_option_value(char_u *name, long *numval, char_u **stringval, int *flagsp, int scope);
Expand Down
11 changes: 5 additions & 6 deletions src/proto/optionstr.pro
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// MacVim options
char *did_set_fuoptions(optset_T *args);
int expand_set_fuoptions(optexpand_T *args, int *numMatches, char_u ***matches);
int check_fuoptions(void);

// optionstr.c
void didset_string_options(void);
void trigger_optionset_string(int opt_idx, int opt_flags, char_u *oldval, char_u *oldval_l, char_u *oldval_g, char_u *newval);
Expand Down Expand Up @@ -222,10 +227,4 @@ int check_ff_value(char_u *p);
void save_clear_shm_value(void);
void restore_shm_value(void);
void export_myvimdir(void);

// MacVim options
char *did_set_fuoptions(optset_T *args);
int expand_set_fuoptions(optexpand_T *args, int *numMatches, char_u ***matches);
int check_fuoptions(void);

// vim: ft=c
6 changes: 3 additions & 3 deletions src/proto/os_macosx.pro
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// MacVim
void macosx_fork(void);

// manually generated from os_macosx.m
void process_cfrunloop(void);
bool sound_mch_play(const char_u* event, long sound_id, soundcb_T *callback, bool playfile);
void sound_mch_stop(long sound_id);
void sound_mch_clear(void);
void sound_mch_free(void);

// MacVim
void macosx_fork(void);
// vim: ft=c
8 changes: 6 additions & 2 deletions src/vim.h
Original file line number Diff line number Diff line change
Expand Up @@ -2280,9 +2280,13 @@ typedef int sock_T;
#define VV_VIM_DID_INIT 116
#define VV_CLIPPROVIDERS 117
#define VV_IMAGEBACKEND 118
#define VV_LEN 119 // number of v: vars

// MacVim-specific values go here
#define VV_OS_APPEARANCE 119
#define VV_LEN 120 // number of v: vars
enum { VV_VIM_UPSTREAM_LEN = VV_LEN };
#define VV_OS_APPEARANCE VV_VIM_UPSTREAM_LEN
#undef VV_LEN
#define VV_LEN VV_VIM_UPSTREAM_LEN + 1

// used for v_number in VAR_BOOL and VAR_SPECIAL
#define VVAL_FALSE 0L // VAR_BOOL
Expand Down
Loading