diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-05-28 13:09:50 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-05-28 13:09:59 -0400 |
commit | 3972f6cde741a03eb04a413f61983f2d768127c2 (patch) | |
tree | 42bedb0a0915fd82e809c6c23b812518ebd872ac | |
parent | 3dddceedceebb73b93d399f2c56b0f1b5394c645 (diff) | |
parent | 6fc28397950f367f4b9e5b56b9d135dde2410e76 (diff) | |
download | rneovim-3972f6cde741a03eb04a413f61983f2d768127c2.tar.gz rneovim-3972f6cde741a03eb04a413f61983f2d768127c2.tar.bz2 rneovim-3972f6cde741a03eb04a413f61983f2d768127c2.zip |
Merge #500 'Remove/simplify #ifdefs on default features'
-rw-r--r-- | config/config.h.in | 76 | ||||
-rw-r--r-- | src/nvim/buffer.c | 21 | ||||
-rw-r--r-- | src/nvim/charset.c | 24 | ||||
-rw-r--r-- | src/nvim/edit.c | 3 | ||||
-rw-r--r-- | src/nvim/eval.c | 9 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 9 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 5 | ||||
-rw-r--r-- | src/nvim/fileio.c | 6 | ||||
-rw-r--r-- | src/nvim/fileio.h | 2 | ||||
-rw-r--r-- | src/nvim/getchar.c | 2 | ||||
-rw-r--r-- | src/nvim/globals.h | 1 | ||||
-rw-r--r-- | src/nvim/main.c | 2 | ||||
-rw-r--r-- | src/nvim/memline.c | 5 | ||||
-rw-r--r-- | src/nvim/menu.c | 5 | ||||
-rw-r--r-- | src/nvim/message.c | 9 | ||||
-rw-r--r-- | src/nvim/misc1.c | 6 | ||||
-rw-r--r-- | src/nvim/misc2.c | 8 | ||||
-rw-r--r-- | src/nvim/option.c | 27 | ||||
-rw-r--r-- | src/nvim/option_defs.h | 5 | ||||
-rw-r--r-- | src/nvim/path.c | 3 | ||||
-rw-r--r-- | src/nvim/regexp.c | 3 | ||||
-rw-r--r-- | src/nvim/screen.c | 37 | ||||
-rw-r--r-- | src/nvim/search.c | 5 | ||||
-rw-r--r-- | src/nvim/strings.c | 3 | ||||
-rw-r--r-- | src/nvim/syntax.c | 7 | ||||
-rw-r--r-- | src/nvim/term.c | 11 | ||||
-rw-r--r-- | src/nvim/testdir/test95.in | 3 | ||||
-rw-r--r-- | src/nvim/ui.c | 12 | ||||
-rw-r--r-- | src/nvim/window.c | 3 |
29 files changed, 48 insertions, 264 deletions
diff --git a/config/config.h.in b/config/config.h.in index 88352b1d71..92cee5c28d 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -99,44 +99,8 @@ #define USEMAN_S 1 #define USEMEMMOVE 1 -#define FEAT_ARABIC -#define FEAT_AUTOCHDIR -#define FEAT_AUTOCMD #define FEAT_BROWSE -#define FEAT_BROWSE_CMD -#define FEAT_BYTEOFF -#define FEAT_CINDENT -#define FEAT_CMDHIST -#define FEAT_CMDL_COMPL -#define FEAT_CMDL_INFO -#define FEAT_CMDWIN -#define FEAT_COMMENTS -#define FEAT_COMPL_FUNC -#define FEAT_CONCEAL -#define FEAT_CON_DIALOG #define FEAT_CSCOPE -#define FEAT_CURSORBIND -#define FEAT_DIFF -#define FEAT_DIGRAPHS -#define FEAT_EVAL -#define FEAT_EX_EXTRA -#define FEAT_FIND_ID -#define FEAT_FKMAP -#define FEAT_FLOAT -#define FEAT_FOLDING -#define FEAT_GETTEXT -#define FEAT_HANGULIN -#define FEAT_INS_EXPAND -#define FEAT_JUMPLIST -#define FEAT_KEYMAP -#define FEAT_LANGMAP -#define FEAT_LINEBREAK -#define FEAT_LISP -#define FEAT_LISTCMDS -#define FEAT_LOCALMAP -#define FEAT_MBYTE -#define FEAT_MENU -#define FEAT_MODIFY_FNAME #define FEAT_MOUSE #define FEAT_MOUSE_DEC #define FEAT_MOUSE_NET @@ -144,44 +108,4 @@ #define FEAT_MOUSE_TTY #define FEAT_MOUSE_URXVT #define FEAT_MOUSE_XTERM -#define FEAT_MULTI_LANG -#define FEAT_PATH_EXTRA -#define FEAT_PERSISTENT_UNDO -#define FEAT_POSTSCRIPT -#define FEAT_PRINTER -#define FEAT_PROFILE -#define FEAT_QUICKFIX -#define FEAT_RELTIME -#define FEAT_RIGHTLEFT -#define FEAT_SCROLLBIND -#define FEAT_SEARCHPATH -#define FEAT_SEARCH_EXTRA -#define FEAT_SESSION -#define FEAT_SMARTINDENT -#define FEAT_SPELL -#define FEAT_STL_OPT -#define FEAT_SYN_HL -#define FEAT_TAG_BINS -#define FEAT_TAG_OLDSTATIC #define FEAT_TERMRESPONSE -#define FEAT_TEXTOBJ -#define FEAT_TITLE -#define FEAT_USR_CMDS -#define FEAT_VERTSPLIT -#define FEAT_VIMINFO -#define FEAT_VIRTUALEDIT -#define FEAT_VISUAL -#define FEAT_VISUALEXTRA -#define FEAT_VREPLACE -#define FEAT_WAK -#define FEAT_WILDIGN -#define FEAT_WILDMENU -#define FEAT_WINDOWS -#define FEAT_WRITEBACK -#define FEAT_HUGE -#define FEAT_BIG -#define FEAT_NORMAL -#define FEAT_SMALL -#define FEAT_TINY -#define FEAT_WRITEBACKUP -#define VIM_BACKTICK /* internal backtick expansion */ diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 946053140d..d3dcb375b2 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -601,14 +601,12 @@ static void clear_wininfo(buf_T *buf) */ void goto_buffer(exarg_T *eap, int start, int dir, int count) { -# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION) - buf_T *old_curbuf = curbuf; - - swap_exists_action = SEA_DIALOG; -# endif (void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO, start, dir, count, eap->forceit); -# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION) +#ifdef HAS_SWAP_EXISTS_ACTION + buf_T *old_curbuf = curbuf; + swap_exists_action = SEA_DIALOG; + if (swap_exists_action == SEA_QUIT && *eap->cmd == 's') { cleanup_T cs; @@ -624,9 +622,10 @@ void goto_buffer(exarg_T *eap, int start, int dir, int count) /* Restore the error/interrupt/exception state if not discarded by a * new aborting error, interrupt, or uncaught exception. */ leave_cleanup(&cs); - } else + } else { handle_swap_exists(old_curbuf); -# endif + } +#endif } #if defined(HAS_SWAP_EXISTS_ACTION) || defined(PROTO) @@ -1112,12 +1111,9 @@ do_buffer ( /* Go to the other buffer. */ set_curbuf(buf, action); -#if defined(FEAT_LISTCMDS) \ - && (defined(FEAT_SCROLLBIND) || defined(FEAT_CURSORBIND)) if (action == DOBUF_SPLIT) { RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */ } -#endif if (aborting()) /* autocmds may abort script processing */ return FAIL; @@ -3511,8 +3507,6 @@ build_stl_str_hl ( return width; } -#if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) \ - || defined(FEAT_GUI_TABLINE) || defined(PROTO) /* * Get relative cursor position in window into "buf[buflen]", in the form 99%, * using "Top", "Bot" or "All" when appropriate. @@ -3535,7 +3529,6 @@ void get_rel_pos(win_T *wp, char_u *buf, int buflen) ? (int)(above / ((above + below) / 100L)) : (int)(above * 100L / (above + below))); } -#endif /* * Append (file 2 of 8) to "buf[buflen]", if editing more than one file. diff --git a/src/nvim/charset.c b/src/nvim/charset.c index ae5da557d5..1c979365bf 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -321,11 +321,6 @@ void trans_characters(char_u *buf, int bufsize) } } -#if defined(FEAT_EVAL) \ - || defined(FEAT_TITLE) \ - || defined(FEAT_INS_EXPAND) \ - || defined(PROTO) - /// Translate a string into allocated memory, replacing special chars with /// printable chars. Returns NULL when out of memory. /// @@ -394,9 +389,6 @@ char_u *transstr(char_u *s) return res; } -#endif // if defined(FEAT_EVAL) || defined(FEAT_TITLE) - // || defined(FEAT_INS_EXPAND) || defined(PROTO) - /// Convert the string "str[orglen]" to do ignore-case comparing. Uses the /// current locale. /// @@ -756,19 +748,11 @@ int vim_strnsize(char_u *s, int len) return ptr2cells(p); \ } -#if defined(FEAT_VREPLACE) \ - || defined(FEAT_EX_EXTRA) \ - || defined(FEAT_GUI) \ - || defined(FEAT_VIRTUALEDIT) \ - || defined(PROTO) int chartabsize(char_u *p, colnr_T col) { RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col) } -#endif /* if defined(FEAT_VREPLACE) || defined(FEAT_EX_EXTRA) || - defined(FEAT_GUI) || defined(FEAT_VIRTUALEDIT) || defined(PROTO) */ - static int win_chartabsize(win_T *wp, char_u *p, colnr_T col) { RET_WIN_BUF_CHARTABSIZE(wp, wp->w_buffer, p, col) @@ -1838,9 +1822,7 @@ int hex2nr(int c) return c - '0'; } -#if defined(FEAT_TERMRESPONSE) \ - || (defined(FEAT_GUI_GTK) && defined(FEAT_WINDOWS)) \ - || defined(PROTO) +#if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) || defined(PROTO) /// Convert two hex characters to a byte. /// Return -1 if one of the characters is not hex. @@ -1857,8 +1839,8 @@ int hexhex2nr(char_u *p) return (hex2nr(p[0]) << 4) + hex2nr(p[1]); } -#endif // if defined(FEAT_TERMRESPONSE) || (defined(FEAT_GUI_GTK) - // && defined(FEAT_WINDOWS)) || defined(PROTO) +#endif // if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) + // || defined(PROTO) /// Return TRUE if "str" starts with a backslash that should be removed. /// For WIN32 this is only done when the character after the diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 6ea88843ab..338721d46d 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -1763,8 +1763,6 @@ void truncate_spaces(char_u *line) line[i + 1] = NUL; } -#if defined(FEAT_VREPLACE) || defined(FEAT_INS_EXPAND) \ - || defined(FEAT_COMMENTS) || defined(PROTO) /* * Backspace the cursor until the given column. Handles REPLACE and VREPLACE * modes correctly. May also be used when not in insert mode at all. @@ -1781,7 +1779,6 @@ void backspace_until_column(int col) break; } } -#endif /* * Like del_char(), but make sure not to go before column "limit_col". diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 95fb6ed732..db57f73a1f 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12,6 +12,7 @@ #include <string.h> #include <stdlib.h> +#include <math.h> #include "nvim/vim.h" #include "nvim/eval.h" #include "nvim/buffer.h" @@ -69,10 +70,6 @@ #include "nvim/os/time.h" #include "nvim/os/channel.h" -#if defined(FEAT_FLOAT) -# include <math.h> -#endif - #define DICT_MAXNEST 100 /* maximum nesting of lists and dicts */ #define DO_NOT_FREE_CNT 99999 /* refcount for dict or list that should not @@ -1554,9 +1551,6 @@ call_func_retnr ( return retval; } -#if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) \ - || defined(FEAT_COMPL_FUNC) || defined(PROTO) - /* * Call vimL function "func" and return the result as a string. * Returns NULL when calling the function fails. @@ -1608,7 +1602,6 @@ call_func_retlist ( return rettv.vval.v_list; } -#endif /* * Save the current function call pointer, and set it to NULL. diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index b4155b417d..c37998e26e 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -3228,8 +3228,7 @@ void ex_checktime(exarg_T *eap) no_check_timestamps = save_no_check_timestamps; } -#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ - && (defined(FEAT_EVAL) || defined(FEAT_MULTI_LANG)) +#if defined(HAVE_LOCALE_H) || defined(X_LOCALE) # define HAVE_GET_LOCALE_VAL static char *get_locale_val(int what); @@ -3395,7 +3394,7 @@ void ex_language(exarg_T *eap) #endif { loc = setlocale(what, (char *)name); -#if defined(FEAT_FLOAT) && defined(LC_NUMERIC) +#ifdef LC_NUMERIC /* Make sure strtod() uses a decimal point, not a comma. */ setlocale(LC_NUMERIC, "C"); #endif @@ -3415,9 +3414,7 @@ void ex_language(exarg_T *eap) if (what != LC_TIME) { /* Tell gettext() what to translate to. It apparently doesn't - * use the currently effective locale. Also do this when - * FEAT_GETTEXT isn't defined, so that shell commands use this - * value. */ + * use the currently effective locale. */ if (what == LC_ALL) { vim_setenv((char_u *)"LANG", name); diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 832870cf2d..f17734eb5e 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4182,8 +4182,6 @@ int ends_excmd(int c) return c == NUL || c == '|' || c == '"' || c == '\n'; } -#if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA) || defined(FEAT_EVAL) \ - || defined(PROTO) /* * Return the next command, after the first '|' or '\n'. * Return NULL if not found. @@ -4197,7 +4195,6 @@ char_u *find_nextcmd(char_u *p) } return p + 1; } -#endif /* * Check if *p is a separator between Ex commands. @@ -7068,7 +7065,7 @@ static void close_redir(void) } } -#if defined(FEAT_SESSION) && defined(USE_CRNL) +#ifdef USE_CRNL # define MKSESSION_NL static int mksession_nl = FALSE; /* use NL only in put_eol() */ #endif diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 290ff424cc..6c42a2bef3 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -1493,7 +1493,7 @@ retry: /* Detected a UTF-8 error. */ rewind_retry: /* Retry reading with another conversion. */ -# if defined(FEAT_EVAL) && defined(USE_ICONV) +# ifdef USE_ICONV if (*p_ccv != NUL && iconv_fd != (iconv_t)-1) /* iconv() failed, try 'charconvert' */ did_iconv = TRUE; @@ -5361,8 +5361,6 @@ void forward_slash(char_u *fname) /* * Code for automatic commands. - * - * Only included when "FEAT_AUTOCMD" has been defined. */ @@ -6460,7 +6458,6 @@ int check_nomodeline(char_u **argp) * Search for a visible window containing the current buffer. If there isn't * one then use "aucmd_win". * Set "curbuf" and "curwin" to match "buf". - * When FEAT_AUTOCMD is not defined another version is used, see below. */ void aucmd_prepbuf ( @@ -6546,7 +6543,6 @@ aucmd_prepbuf ( /* * Cleanup after executing autocommands for a (hidden) buffer. * Restore the window as it was (if possible). - * When FEAT_AUTOCMD is not defined another version is used, see below. */ void aucmd_restbuf ( diff --git a/src/nvim/fileio.h b/src/nvim/fileio.h index 2d61c21fb5..137f8506ba 100644 --- a/src/nvim/fileio.h +++ b/src/nvim/fileio.h @@ -6,7 +6,7 @@ /* * Struct to save values in before executing autocommands for a buffer that is - * not the current buffer. Without FEAT_AUTOCMD only "curbuf" is remembered. + * not the current buffer. */ typedef struct { buf_T *save_curbuf; /* saved curbuf */ diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index d215bb06e7..114182d462 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -4270,7 +4270,6 @@ check_map ( } -#if defined(MSWIN) || defined(FEAT_CMDWIN) || defined(MACOS) || defined(PROTO) /* * Add a mapping "map" for mode "mode". * Need to put string in allocated memory, because do_map() will modify it. @@ -4286,4 +4285,3 @@ void add_map(char_u *map, int mode) free(s); p_cpo = cpo_save; } -#endif diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 869972e3b4..331d7ec5a4 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -395,7 +395,6 @@ EXTERN int updating_screen INIT(= FALSE); * All windows are linked in a list. firstwin points to the first entry, * lastwin to the last entry (can be the same as firstwin) and curwin to the * currently active window. - * Without the FEAT_WINDOWS they are all equal. */ EXTERN win_T *firstwin; /* first window */ EXTERN win_T *lastwin; /* last window */ diff --git a/src/nvim/main.c b/src/nvim/main.c index 91e879cbe0..ffb83ae7d8 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -880,7 +880,7 @@ static void init_locale(void) { setlocale(LC_ALL, ""); -# if defined(FEAT_FLOAT) && defined(LC_NUMERIC) +# ifdef LC_NUMERIC /* Make sure strtod() uses a decimal point, not a comma. */ setlocale(LC_NUMERIC, "C"); # endif diff --git a/src/nvim/memline.c b/src/nvim/memline.c index c831727a0a..2526f9d98b 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -1501,7 +1501,7 @@ static char_u *make_percent_swname(char_u *dir, char_u *name) } #endif -#if defined(UNIX) && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)) +#ifdef UNIX static int process_still_running; #endif @@ -2437,7 +2437,6 @@ static int ml_delete_int(buf_T *buf, linenr_T lnum, int message) ) set_keep_msg((char_u *)_(no_lines_msg), 0); - /* FEAT_BYTEOFF already handled in there, don't worry 'bout it below */ i = ml_replace((linenr_T)1, (char_u *)"", TRUE); buf->b_ml.ml_flags |= ML_EMPTY; @@ -3406,7 +3405,7 @@ findswapname ( int choice = 0; #endif -#if defined(UNIX) && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)) +#ifdef UNIX process_still_running = FALSE; #endif /* diff --git a/src/nvim/menu.c b/src/nvim/menu.c index f71c1a351d..0f86a65bb5 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -1274,8 +1274,6 @@ static int menu_is_hidden(char_u *name) return (name[0] == ']') || (menu_is_popup(name) && name[5] != NUL); } -#if defined(FEAT_CMDL_COMPL) \ - || (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)) /* * Return TRUE if the menu is the tearoff menu. */ @@ -1283,7 +1281,6 @@ static int menu_is_tearoff(char_u *name) { return FALSE; } -#endif @@ -1398,7 +1395,7 @@ void ex_emenu(exarg_T *eap) } #if defined(FEAT_GUI_MSWIN) \ - || (defined(FEAT_GUI_GTK) && defined(FEAT_MENU)) \ + || defined(FEAT_GUI_GTK) \ || defined(FEAT_BEVAL_TIP) || defined(PROTO) /* * Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy. diff --git a/src/nvim/message.c b/src/nvim/message.c index 9bdcbf6c78..44fbdb6091 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -13,6 +13,7 @@ #define MESSAGE_FILE /* don't include prototype for smsg() */ #include <string.h> +#include <math.h> #include "nvim/vim.h" #include "nvim/message.h" @@ -37,10 +38,6 @@ #include "nvim/os/os.h" #include "nvim/os/event.h" -#if defined(FEAT_FLOAT) -# include <math.h> -#endif - static int other_sourcing_name(void); static char_u *get_emsg_source(void); static char_u *get_emsg_lnum(void); @@ -156,7 +153,6 @@ int msg(char_u *s) return msg_attr_keep(s, 0, FALSE); } -#if defined(FEAT_EVAL) || defined(FEAT_GUI_GTK) || defined(PROTO) /* * Like msg() but keep it silent when 'verbosefile' is set. */ @@ -170,7 +166,6 @@ int verb_msg(char_u *s) return n; } -#endif int msg_attr(char_u *s, int attr) { @@ -3054,7 +3049,6 @@ int vim_dialog_yesnoallcancel(int type, char_u *title, char_u *message, int dflt -#if defined(FEAT_EVAL) static char *e_printf = N_("E766: Insufficient arguments for printf()"); static long tv_nr(typval_T *tvs, int *idxp); @@ -3120,7 +3114,6 @@ static double tv_float(typval_T *tvs, int *idxp) } return f; } -#endif /* * This code was included to provide a portable vsnprintf() and snprintf(). diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index e63ca008bc..18a6e4bd7a 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -102,10 +102,7 @@ open_line ( char_u *lead_flags; /* position in 'comments' for comment leader */ char_u *leader = NULL; /* copy of comment leader */ char_u *allocated = NULL; /* allocated memory */ -#if defined(FEAT_SMARTINDENT) || defined(FEAT_VREPLACE) || defined(FEAT_LISP) \ - || defined(FEAT_CINDENT) || defined(FEAT_COMMENTS) char_u *p; -#endif int saved_char = NUL; /* init for GCC */ pos_T *pos; int do_si = (!p_paste && curbuf->b_p_si @@ -1378,8 +1375,6 @@ void ins_bytes(char_u *p) ins_bytes_len(p, (int)STRLEN(p)); } -#if defined(FEAT_VREPLACE) || defined(FEAT_INS_EXPAND) \ - || defined(FEAT_COMMENTS) || defined(FEAT_MBYTE) || defined(PROTO) /* * Insert string "p" with length "len" at the cursor position. * Handles Replace mode and multi-byte characters. @@ -1402,7 +1397,6 @@ void ins_bytes_len(char_u *p, int len) for (i = 0; i < len; ++i) ins_char(p[i]); } -#endif /* * Insert or replace a single character at the cursor position. diff --git a/src/nvim/misc2.c b/src/nvim/misc2.c index 1db6c4193c..c9c3edca71 100644 --- a/src/nvim/misc2.c +++ b/src/nvim/misc2.c @@ -362,10 +362,6 @@ int get_real_state(void) return State; } -#if defined(FEAT_SESSION) || defined(MSWIN) || defined(FEAT_GUI_MAC) \ - || ((defined(FEAT_GUI_GTK)) \ - && ( defined(FEAT_WINDOWS) || defined(FEAT_DND)) ) \ - || defined(PROTO) /* * Change to a file's directory. * Caller must call shorten_fnames()! @@ -379,11 +375,9 @@ int vim_chdirfile(char_u *fname) *path_tail_with_sep(dir) = NUL; return os_chdir((char *)dir) == 0 ? OK : FAIL; } -#endif /* - * Change directory to "new_dir". If FEAT_SEARCHPATH is defined, search - * 'cdpath' for relative directory names, otherwise just os_chdir(). + * Change directory to "new_dir". Search 'cdpath' for relative directory names. */ int vim_chdir(char_u *new_dir) { diff --git a/src/nvim/option.c b/src/nvim/option.c index 5934f57dc8..1408979288 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -353,17 +353,14 @@ struct vimoption { * for the currency sign. */ # define ISP_LATIN1 (char_u *)"@,161-255" -/* The 16 bit MS-DOS version is low on space, make the string as short as - * possible when compiling with few features. */ -#if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \ - || defined(FEAT_VERTSPLIT) \ - || defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) || defined(FEAT_CONCEAL) -# define HIGHLIGHT_INIT \ - "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn" -#else -# define HIGHLIGHT_INIT \ - "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill" -#endif +#define HIGHLIGHT_INIT \ + "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search," \ + "m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine," \ + "S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg," \ + "W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete," \ + "T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare," \ + "L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine," \ + "#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn" /* * options[] is initialized here. @@ -2035,8 +2032,7 @@ void set_init_1(void) } } -#if defined(FEAT_POSTSCRIPT) && (defined(MSWIN) || \ - defined(EBCDIC) || defined(MAC)) +#if defined(MSWIN) || defined(EBCDIC) || defined(MAC) /* Set print encoding on platforms that don't default to latin1 */ set_string_default("penc", (char_u *)"hp-roman8" @@ -7564,9 +7560,8 @@ static int wc_use_keyname(char_u *varp, long *wcp) * * langmap_mapchar[] maps any of 256 chars to an ASCII char used for Vim * commands. - * When FEAT_MBYTE is defined langmap_mapga.ga_data is a sorted table of - * langmap_entry_T. This does the same as langmap_mapchar[] for characters >= - * 256. + * langmap_mapga.ga_data is a sorted table of langmap_entry_T. + * This does the same as langmap_mapchar[] for characters >= 256. */ /* * With multi-byte support use growarray for 'langmap' chars >= 256 diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index ae08b1fa5f..741ddc750c 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -616,12 +616,7 @@ extern char_u *p_vfile; /* 'verbosefile' */ EXTERN int p_warn; /* 'warn' */ EXTERN char_u *p_wop; /* 'wildoptions' */ EXTERN long p_window; /* 'window' */ -#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(LINT) \ - || defined (FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) -#define FEAT_WAK EXTERN char_u *p_wak; /* 'winaltkeys' */ -#endif -EXTERN char_u *p_wak; EXTERN char_u *p_wig; /* 'wildignore' */ EXTERN int p_wiv; /* 'weirdinvert' */ EXTERN char_u *p_ww; /* 'whichwrap' */ diff --git a/src/nvim/path.c b/src/nvim/path.c index 5a1c9cd1c3..1222b97fd6 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -165,8 +165,6 @@ int vim_ispathlistsep(int c) #endif } -#if defined(FEAT_GUI_TABLINE) || defined(FEAT_WINDOWS) \ - || defined(FEAT_EVAL) || defined(PROTO) /* * Shorten the path of a file from "~/foo/../.bar/fname" to "~/f/../.b/fname" * It's done in-place. @@ -199,7 +197,6 @@ void shorten_dir(char_u *str) } } } -#endif /* * Return TRUE if the directory of "fname" exists, FALSE otherwise. diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index de4220f93a..6f2a522801 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -7086,8 +7086,6 @@ vim_regexec ( return rmp->regprog->engine->regexec_nl(rmp, line, col, false); } -#if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) \ - || defined(FIND_REPLACE_DIALOG) || defined(PROTO) /* * Like vim_regexec(), but consider a "\n" in "line" to be a line break. */ @@ -7095,7 +7093,6 @@ int vim_regexec_nl(regmatch_T *rmp, char_u *line, colnr_T col) { return rmp->regprog->engine->regexec_nl(rmp, line, col, true); } -#endif /* * Match a regexp against multiple lines. diff --git a/src/nvim/screen.c b/src/nvim/screen.c index e14f7d20d3..aba229f1d1 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2301,11 +2301,7 @@ win_line ( int change_end = -1; /* last col of changed area */ colnr_T trailcol = MAXCOL; /* start of trailing spaces */ int need_showbreak = FALSE; -#if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \ - || defined(FEAT_SYN_HL) || defined(FEAT_DIFF) -# define LINE_ATTR int line_attr = 0; /* attribute for the whole line */ -#endif matchitem_T *cur; /* points to the match list */ match_T *shl; /* points to search_hl or a match */ int shl_flag; /* flag to indicate whether search_hl @@ -2315,9 +2311,7 @@ win_line ( of the matches */ int prev_c = 0; /* previous Arabic character */ int prev_c1 = 0; /* first composing char for prev_c */ -#if defined(LINE_ATTR) int did_line_attr = 0; -#endif /* draw_state: items that are drawn in sequence: */ #define WL_START 0 /* nothing done yet */ @@ -2518,7 +2512,6 @@ win_line ( filler_lines = wp->w_topfill; filler_todo = filler_lines; -#ifdef LINE_ATTR /* If this line has a sign with line highlighting set line_attr. */ v = buf_getsigntype(wp->w_buffer, lnum, SIGN_LINEHL); if (v != 0) @@ -2529,7 +2522,6 @@ win_line ( line_attr = hl_attr(HLF_L); if (line_attr != 0) area_highlighting = TRUE; -#endif line = ml_get_buf(wp->w_buffer, lnum, FALSE); ptr = line; @@ -3036,14 +3028,12 @@ win_line ( char_attr = area_attr; else if (search_attr != 0) char_attr = search_attr; -#ifdef LINE_ATTR /* Use line_attr when not in the Visual or 'incsearch' area * (area_attr may be 0 when "noinvcur" is set). */ else if (line_attr != 0 && ((fromcol == -10 && tocol == MAXCOL) || vcol < fromcol || vcol_prev < fromcol_prev || vcol >= tocol)) char_attr = line_attr; -#endif else { attr_pri = FALSE; if (has_syntax) @@ -3509,15 +3499,7 @@ win_line ( * character if the line break is included. */ /* For a diff line the highlighting continues after the * "$". */ - if ( - diff_hlf == (hlf_T)0 -# ifdef LINE_ATTR - && -# endif -# ifdef LINE_ATTR - line_attr == 0 -# endif - ) { + if (diff_hlf == (hlf_T)0 && line_attr == 0) { /* In virtualedit, visual selections may extend * beyond end of line. */ if (area_highlighting && virtual_active() @@ -3570,9 +3552,7 @@ win_line ( (col < W_WIDTH(wp)))) { c = ' '; --ptr; /* put it back at the NUL */ - } -#if defined(LINE_ATTR) - else if (( + } else if (( diff_hlf != (hlf_T)0 || line_attr != 0 ) && ( @@ -3596,7 +3576,6 @@ win_line ( char_attr = hl_attr(diff_hlf); } } -#endif } if ( wp->w_p_cole > 0 @@ -3705,11 +3684,7 @@ win_line ( /* * At end of the text line or just after the last character. */ - if (c == NUL -#if defined(LINE_ATTR) - || did_line_attr == 1 -#endif - ) { + if (c == NUL || did_line_attr == 1) { long prevcol = (long)(ptr - line) - (c == NUL); /* we're not really at that column when skipping some text */ @@ -3740,11 +3715,7 @@ win_line ( || lnum == curwin->w_cursor.lnum) && c == NUL) /* highlight 'hlsearch' match at end of line */ - || (prevcol_hl_flag == TRUE -# if defined(LINE_ATTR) - && did_line_attr <= 1 -# endif - ) + || (prevcol_hl_flag == TRUE && did_line_attr <= 1) )) { int n = 0; diff --git a/src/nvim/search.c b/src/nvim/search.c index fc741955da..b341b4be68 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -449,7 +449,7 @@ void last_pat_prog(regmmatch_T *regmatch) * if (options & SEARCH_PEEK) check for typed char, cancel search * * Return FAIL (zero) for failure, non-zero for success. - * When FEAT_EVAL is defined, returns the index of the first matching + * Returns the index of the first matching * subpattern plus one; one if there was none. */ int searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm) @@ -3941,8 +3941,6 @@ static int is_one_char(char_u *pattern) return result; } -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(FEAT_TEXTOBJ) \ - || defined(PROTO) /* * return TRUE if line 'lnum' is empty or has white chars only. */ @@ -3953,7 +3951,6 @@ int linewhite(linenr_T lnum) p = skipwhite(ml_get(lnum)); return *p == NUL; } -#endif /* * Find identifiers or defines in included files. diff --git a/src/nvim/strings.c b/src/nvim/strings.c index d8a14c1883..70fa43be2c 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -500,8 +500,6 @@ void sort_strings(char_u **files, int count) qsort((void *)files, (size_t)count, sizeof(char_u *), sort_compare); } -#if (defined(FEAT_MBYTE) && defined(FEAT_QUICKFIX)) \ - || defined(FEAT_SPELL) || defined(PROTO) /* * Return TRUE if string "s" contains a non-ASCII character (128 or higher). * When "s" is NULL FALSE is returned. @@ -516,7 +514,6 @@ int has_non_ascii(char_u *s) return TRUE; return FALSE; } -#endif /* * Concatenate two strings and return the result in allocated memory. diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index ccc6752793..7d39a61b69 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -7522,7 +7522,7 @@ int syn_get_final_id(int hl_id) /* * Translate the 'highlight' option into attributes in highlight_attr[] and - * set up the user highlights User1..9. If FEAT_STL_OPT is in use, a set of + * set up the user highlights User1..9. A set of * corresponding highlights to use on top of HLF_SNC is computed. * Called only when the 'highlight' option has been changed and upon first * screen redraw after any :highlight command. @@ -7611,7 +7611,7 @@ int highlight_changed(void) return FAIL; attr = syn_id2attr(id); p = end - 1; -#if defined(FEAT_STL_OPT) && defined(USER_HIGHLIGHT) +#ifdef USER_HIGHLIGHT if (hlf == (int)HLF_SNC) id_SNC = syn_get_final_id(id); else if (hlf == (int)HLF_S) @@ -7756,8 +7756,6 @@ static void highlight_list_two(int cnt, int attr) } -#if defined(FEAT_CMDL_COMPL) || (defined(FEAT_SYN_HL) && defined(FEAT_EVAL)) \ - || defined(FEAT_SIGNS) || defined(PROTO) /* * Function given to ExpandGeneric() to obtain the list of group names. * Also used for synIDattr() function. @@ -7779,7 +7777,6 @@ char_u *get_highlight_name(expand_T *xp, int idx) return NULL; return HL_TABLE()[idx].sg_name; } -#endif /************************************** diff --git a/src/nvim/term.c b/src/nvim/term.c index 073ed30052..932d58f76d 100644 --- a/src/nvim/term.c +++ b/src/nvim/term.c @@ -2082,8 +2082,6 @@ static void out_char_nf(unsigned c) out_flush(); } -#if defined(FEAT_TITLE) || defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI) \ - || defined(FEAT_TERMRESPONSE) || defined(PROTO) /* * A never-padding out_str. * use this whenever you don't want to run the string through tputs. @@ -2104,7 +2102,6 @@ void out_str_nf(char_u *s) if (p_wd) out_flush(); } -#endif /* * out_str(s): Put a character string a byte at a time into the output buffer. @@ -2219,8 +2216,7 @@ static void term_color(char_u *s, int n) OUT_STR(tgoto((char *)s, 0, n)); } -#if (defined(FEAT_TITLE) && (defined(UNIX) || \ - defined(MACOS_X))) || defined(PROTO) +#if defined(UNIX) || defined(MACOS_X) || defined(PROTO) /* * Generic function to set window title, using t_ts and t_fs. */ @@ -2324,8 +2320,7 @@ void ttest(int pairs) t_colors = atoi((char *)T_CCO); } -#if (defined(FEAT_GUI) && (defined(FEAT_MENU) || !defined(USE_ON_FLY_SCROLL))) \ - || defined(PROTO) +#if defined(FEAT_GUI) || defined(PROTO) static int get_long_from_buf(char_u *buf, long_u *val); /* @@ -3137,7 +3132,7 @@ static void switch_to_8bit(void) static linenr_T orig_topline = 0; static int orig_topfill = 0; #endif -#if (defined(FEAT_WINDOWS) && defined(CHECK_DOUBLE_CLICK)) || defined(PROTO) +#if defined(CHECK_DOUBLE_CLICK) || defined(PROTO) /* * Checking for double clicks ourselves. * "orig_topline" is used to avoid detecting a double-click when the window diff --git a/src/nvim/testdir/test95.in b/src/nvim/testdir/test95.in index 90fa69945a..9afcc7fa6a 100644 --- a/src/nvim/testdir/test95.in +++ b/src/nvim/testdir/test95.in @@ -19,8 +19,7 @@ STARTTEST :" When there is no match use only the first two items. :let tl = [] -:"""" Multi-byte character tests. These will fail unless vim is compiled -:"""" with Multibyte (FEAT_MBYTE) or BIG/HUGE features. +:"""" Multi-byte character tests. :call add(tl, [2, '[[:alpha:][=a=]]\+', '879 aiaãâaiuvna ', 'aiaãâaiuvna']) :call add(tl, [2, '[[=a=]]\+', 'ddaãâbcd', 'aãâ']) " equivalence classes :call add(tl, [2, '[^ม ]\+', 'มม oijasoifjos ifjoisj f osij j มมมมม abcd', 'oijasoifjos']) diff --git a/src/nvim/ui.c b/src/nvim/ui.c index ef61117126..256d35f089 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -328,9 +328,8 @@ void add_to_input_buf(char_u *s, int len) #if ((defined(FEAT_XIM) || defined(FEAT_DND)) && defined(FEAT_GUI_GTK)) \ || defined(FEAT_GUI_MSWIN) \ || defined(FEAT_GUI_MAC) \ - || (defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)) \ - || (defined(FEAT_GUI) && (!defined(USE_ON_FLY_SCROLL) \ - || defined(FEAT_MENU))) \ + || defined(FEAT_MBYTE_IME) \ + || defined(FEAT_GUI) \ || defined(PROTO) /* * Add "str[len]" to the input buffer while escaping CSI bytes. @@ -352,16 +351,12 @@ void add_to_input_buf_csi(char_u *str, int len) { #endif -#if defined(FEAT_GUI) || defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) \ - || defined(PROTO) /* Remove everything from the input buffer. Called when ^C is found */ void trash_input_buf(void) { inbufcount = 0; } -#endif - /* * Read as much data from the input buffer as possible up to maxlen, and store * it in buf. @@ -494,8 +489,6 @@ void ui_cursor_shape(void) conceal_check_cursur_line(); } -#if defined(FEAT_GUI) || defined(FEAT_RIGHTLEFT) \ - || defined(FEAT_MBYTE) || defined(PROTO) /* * Check bounds for column number */ @@ -519,7 +512,6 @@ int check_row(int row) return (int)screen_Rows - 1; return row; } -#endif /* * Stuff for the X clipboard. Shared between VMS and Unix. diff --git a/src/nvim/window.c b/src/nvim/window.c index 6f97401a80..11ed1c0730 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2782,8 +2782,7 @@ void win_alloc_aucmd_win(void) /* * Allocate the first window or the first window in a new tab page. * When "oldwin" is NULL create an empty buffer for it. - * When "oldwin" is not NULL copy info from it to the new window (only with - * FEAT_WINDOWS). + * When "oldwin" is not NULL copy info from it to the new window. * Return FAIL when something goes wrong (out of memory). */ static int win_alloc_firstwin(win_T *oldwin) |