Mercurial > vim
diff src/misc2.c @ 12716:351cf7c67bbe v8.0.1236
patch 8.0.1236: Mac features are confusing
commit https://github.com/vim/vim/commit/d057301b1f28736f094affa17b190244ad56e8d9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 28 21:11:06 2017 +0200
patch 8.0.1236: Mac features are confusing
Problem: Mac features are confusing.
Solution: Make feature names more consistent, add "osxdarwin". Rename
feature flags, cleanup Mac code. (Kazunobu Kuriyama, closes #2178)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 28 Oct 2017 21:15:35 +0200 |
parents | 4e846c9d61a8 |
children | 5ae0d05e046a |
line wrap: on
line diff
--- a/src/misc2.c +++ b/src/misc2.c @@ -2202,7 +2202,7 @@ static struct modmasktable {MOD_MASK_MULTI_CLICK, MOD_MASK_2CLICK, (char_u)'2'}, {MOD_MASK_MULTI_CLICK, MOD_MASK_3CLICK, (char_u)'3'}, {MOD_MASK_MULTI_CLICK, MOD_MASK_4CLICK, (char_u)'4'}, -#ifdef MACOS +#ifdef MACOS_X {MOD_MASK_CMD, MOD_MASK_CMD, (char_u)'D'}, #endif /* 'A' must be the last one */ @@ -2927,7 +2927,7 @@ extract_modifiers(int key, int *modp) { int modifiers = *modp; -#ifdef MACOS +#ifdef MACOS_X /* Command-key really special, no fancynest */ if (!(modifiers & MOD_MASK_CMD)) #endif @@ -2954,7 +2954,7 @@ extract_modifiers(int key, int *modp) if (key == 0) key = K_ZERO; } -#ifdef MACOS +#ifdef MACOS_X /* Command-key really special, no fancynest */ if (!(modifiers & MOD_MASK_CMD)) #endif @@ -5933,10 +5933,7 @@ pathcmp(const char *p, const char *q, in #define EXTRASIZE 5 /* increment to add to env. size */ static int envsize = -1; /* current size of environment */ -#ifndef MACOS_CLASSIC -extern -#endif - char **environ; /* the global which is your env. */ +extern char **environ; /* the global which is your env. */ static int findenv(char *name); /* look for a name in the env. */ static int newenv(void); /* copy env. from stack to heap */ @@ -6008,19 +6005,14 @@ newenv(void) char **env, *elem; int i, esize; -#ifdef MACOS - /* for Mac a new, empty environment is created */ - i = 0; -#else for (i = 0; environ[i]; i++) ; -#endif + esize = i + EXTRASIZE + 1; env = (char **)alloc((unsigned)(esize * sizeof (elem))); if (env == NULL) return -1; -#ifndef MACOS for (i = 0; environ[i]; i++) { elem = (char *)alloc((unsigned)(strlen(environ[i]) + 1)); @@ -6029,7 +6021,6 @@ newenv(void) env[i] = elem; strcpy(elem, environ[i]); } -#endif env[i] = 0; environ = env; @@ -6093,7 +6084,6 @@ filewritable(char_u *fname) #if defined(UNIX) || defined(VMS) perm = mch_getperm(fname); #endif -#ifndef MACOS_CLASSIC /* TODO: get either mch_writable or mch_access */ if ( # ifdef WIN3264 mch_writable(fname) && @@ -6104,7 +6094,6 @@ filewritable(char_u *fname) # endif mch_access((char *)fname, W_OK) == 0 ) -#endif { ++retval; if (mch_isdir(fname))