diff options
-rw-r--r-- | runtime/doc/builtin.txt | 6 | ||||
-rw-r--r-- | runtime/doc/indent.txt | 3 | ||||
-rw-r--r-- | runtime/doc/options.txt | 22 | ||||
-rw-r--r-- | runtime/doc/various.txt | 6 | ||||
-rw-r--r-- | src/buffer.c | 10 | ||||
-rw-r--r-- | src/change.c | 67 | ||||
-rw-r--r-- | src/charset.c | 2 | ||||
-rw-r--r-- | src/cindent.c | 13 | ||||
-rw-r--r-- | src/edit.c | 66 | ||||
-rw-r--r-- | src/evalfunc.c | 24 | ||||
-rw-r--r-- | src/feature.h | 22 | ||||
-rw-r--r-- | src/globals.h | 2 | ||||
-rw-r--r-- | src/indent.c | 33 | ||||
-rw-r--r-- | src/insexpand.c | 13 | ||||
-rw-r--r-- | src/main.c | 4 | ||||
-rw-r--r-- | src/mouse.c | 4 | ||||
-rw-r--r-- | src/ops.c | 20 | ||||
-rw-r--r-- | src/option.c | 44 | ||||
-rw-r--r-- | src/option.h | 22 | ||||
-rw-r--r-- | src/optiondefs.h | 72 | ||||
-rw-r--r-- | src/optionstr.c | 14 | ||||
-rw-r--r-- | src/register.c | 2 | ||||
-rw-r--r-- | src/search.c | 60 | ||||
-rw-r--r-- | src/structs.h | 14 | ||||
-rw-r--r-- | src/testdir/test_edit.vim | 16 | ||||
-rw-r--r-- | src/textformat.c | 13 | ||||
-rw-r--r-- | src/version.c | 14 |
27 files changed, 80 insertions, 508 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 72e2cf13f1..781f8eba84 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1500,8 +1500,7 @@ cindent({lnum}) *cindent()* indenting rules, as with 'cindent'. The indent is counted in spaces, the value of 'tabstop' is relevant. {lnum} is used just like in |getline()|. - When {lnum} is invalid or Vim was not compiled the |+cindent| - feature, -1 is returned. + When {lnum} is invalid -1 is returned. See |C-indenting|. Can also be used as a |method|: > @@ -5173,8 +5172,7 @@ lispindent({lnum}) *lispindent()* indenting rules, as with 'lisp'. The indent is counted in spaces, the value of 'tabstop' is relevant. {lnum} is used just like in |getline()|. - When {lnum} is invalid or Vim was not compiled the - |+lispindent| feature, -1 is returned. In |Vim9| script an + When {lnum} is invalid -1 is returned. In |Vim9| script an error is given. Can also be used as a |method|: > diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index dfee7f584d..2899fc5b36 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -22,9 +22,6 @@ indent and do not perform other formatting. There are additional options that affect other kinds of formatting as well as indenting, see |format-comments|, |fo-table|, |gq| and |formatting| for the main ones. -Note that this will not work when the |+smartindent| or |+cindent| features -have been disabled at compile time. - There are in fact four main methods available for indentation, each one overrides the previous if it is enabled, or non-empty for 'indentexpr': 'autoindent' uses the indent from the previous line. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 8668233411..b4359190d2 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1621,8 +1621,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'cindent'* *'cin'* *'nocindent'* *'nocin'* 'cindent' 'cin' boolean (default off) local to buffer - {not available when compiled without the |+cindent| - feature} Enables automatic C program indenting. See 'cinkeys' to set the keys that trigger reindenting in insert mode and 'cinoptions' to set your preferred indent style. @@ -1639,8 +1637,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'cinkeys'* *'cink'* 'cinkeys' 'cink' string (default "0{,0},0),0],:,0#,!^F,o,O,e") local to buffer - {not available when compiled without the |+cindent| - feature} A list of keys that, when typed in Insert mode, cause reindenting of the current line. Only used if 'cindent' is on and 'indentexpr' is empty. @@ -1650,8 +1646,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'cinoptions'* *'cino'* 'cinoptions' 'cino' string (default "") local to buffer - {not available when compiled without the |+cindent| - feature} The 'cinoptions' affect the way 'cindent' reindents lines in a C program. See |cinoptions-values| for the values of this option, and |C-indenting| for info on C indenting in general. @@ -1660,8 +1654,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'cinwords'* *'cinw'* 'cinwords' 'cinw' string (default "if,else,while,do,for,switch") local to buffer - {not available when compiled without both the - |+cindent| and the |+smartindent| features} These keywords start an extra indent in the next line when 'smartindent' or 'cindent' is set. For 'cindent' this is only done at an appropriate place (inside {}). @@ -1672,8 +1664,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'cinscopedecls'* *'cinsd'* 'cinscopedecls' 'cinsd' string (default "public,protected,private") local to buffer - {not available when compiled without the |+cindent| - feature} Keywords that are interpreted as a C++ scope declaration by |cino-g|. Useful e.g. for working with the Qt framework that defines additional scope declarations "signals", "public slots" and "private slots": > @@ -4578,8 +4568,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'indentexpr'* *'inde'* 'indentexpr' 'inde' string (default "") local to buffer - {not available when compiled without the |+cindent| - or |+eval| features} + {not available when compiled without the |+eval| + feature} Expression which is evaluated to obtain the proper indent for a line. It is used when a new line is created, for the |=| operator and in Insert mode as specified with the 'indentkeys' option. @@ -4624,8 +4614,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'indentkeys'* *'indk'* 'indentkeys' 'indk' string (default "0{,0},0),0],:,0#,!^F,o,O,e") local to buffer - {not available when compiled without the |+cindent| - feature} A list of keys that, when typed in Insert mode, cause reindenting of the current line. Only happens if 'indentexpr' isn't empty. The format is identical to 'cinkeys', see |indentkeys-format|. @@ -5013,8 +5001,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'lisp'* *'nolisp'* 'lisp' boolean (default off) local to buffer - {not available when compiled without the |+lispindent| - feature} Lisp mode: When <Enter> is typed in insert mode set the indent for the next line to Lisp standards (well, sort of). Also happens with "cc" or "S". 'autoindent' must also be on for this to work. The 'p' @@ -5028,8 +5014,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'lispwords'* *'lw'* 'lispwords' 'lw' string (default is very long) global or local to buffer |global-local| - {not available when compiled without the |+lispindent| - feature} Comma-separated list of words that influence the Lisp indenting. |'lisp'| @@ -7222,8 +7206,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'smartindent'* *'si'* *'nosmartindent'* *'nosi'* 'smartindent' 'si' boolean (default off) local to buffer - {not available when compiled without the - |+smartindent| feature} Do smart autoindenting when starting a new line. Works for C-like programs, but can also be used for other languages. 'cindent' does something like this, works better in most cases, but is more strict, diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 2f6d1c6366..8bfaeaecd2 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -346,7 +346,7 @@ B *++builtin_terms* maximal terminals builtin |builtin-terms| N *+byte_offset* support for 'o' flag in 'statusline' option, "go" and ":goto" commands. m *+channel* inter process communication |channel| -N *+cindent* |'cindent'|, C indenting +6 *+cindent* |'cindent'|, C indenting N *+clientserver* Unix and Win32: Remote invocation |clientserver| *+clipboard* |clipboard| support compiled-in *+clipboard_working* |clipboard| support compiled-in and working @@ -398,7 +398,7 @@ N *+lambda* |lambda| and |closure| B *+langmap* |'langmap'| N *+libcall* |libcall()| N *+linebreak* |'linebreak'|, |'breakat'| and |'showbreak'| -N *+lispindent* |'lisp'| +t *+lispindent* |'lisp'| T *+listcmds* Vim commands for the list of buffers |buffer-hidden| and argument list |:argdelete| T *+localmap* Support for mappings local to a buffer |:map-local| @@ -450,7 +450,7 @@ m *+ruby* Ruby interface |ruby| m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn| T *+scrollbind* |'scrollbind'| B *+signs* |:sign| -N *+smartindent* |'smartindent'| +t *+smartindent* |'smartindent'| B *+sodium* compiled with libsodium for better encryption support B *+sound* |sound_playevent()|, |sound_playfile()| functions, etc. N *+spell* spell checking support, see |spell| diff --git a/src/buffer.c b/src/buffer.c index 3234138aeb..88528e9f33 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -290,9 +290,7 @@ open_buffer( if (curbuf->b_flags & BF_NEVERLOADED) { (void)buf_init_chartab(curbuf, FALSE); -#ifdef FEAT_CINDENT parse_cino(curbuf); -#endif } // Set/reset the Changed flag first, autocmds may change the buffer. @@ -2274,7 +2272,7 @@ free_buf_options( clear_string_option(&buf->b_p_inex); # endif #endif -#if defined(FEAT_CINDENT) && defined(FEAT_EVAL) +#if defined(FEAT_EVAL) clear_string_option(&buf->b_p_inde); clear_string_option(&buf->b_p_indk); #endif @@ -2335,14 +2333,10 @@ free_buf_options( clear_string_option(&buf->b_p_sua); #endif clear_string_option(&buf->b_p_ft); -#ifdef FEAT_CINDENT clear_string_option(&buf->b_p_cink); clear_string_option(&buf->b_p_cino); clear_string_option(&buf->b_p_cinsd); -#endif -#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT) clear_string_option(&buf->b_p_cinw); -#endif clear_string_option(&buf->b_p_cpt); #ifdef FEAT_COMPL_FUNC clear_string_option(&buf->b_p_cfu); @@ -2372,9 +2366,7 @@ free_buf_options( #endif buf->b_p_ar = -1; buf->b_p_ul = NO_LOCAL_UNDOLEVEL; -#ifdef FEAT_LISP clear_string_option(&buf->b_p_lw); -#endif clear_string_option(&buf->b_p_bkc); clear_string_option(&buf->b_p_menc); } diff --git a/src/change.c b/src/change.c index 2d01f92586..25a96f85c2 100644 --- a/src/change.c +++ b/src/change.c @@ -1397,17 +1397,11 @@ open_line( char_u *p; int saved_char = NUL; // init for GCC pos_T *pos; -#ifdef FEAT_CINDENT int do_cindent; -#endif -#ifdef FEAT_SMARTINDENT int do_si = may_do_si(); int no_si = FALSE; // reset did_si afterwards int first_char = NUL; // init for GCC -#endif -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) int vreplace_mode; -#endif int did_append; // appended a new line int saved_pi = curbuf->b_p_pi; // copy of preserveindent setting @@ -1453,22 +1447,18 @@ open_line( if ((State & MODE_INSERT) && (State & VREPLACE_FLAG) == 0) { p_extra = saved_line + curwin->w_cursor.col; -#ifdef FEAT_SMARTINDENT if (do_si) // need first char after new line break { p = skipwhite(p_extra); first_char = *p; } -#endif extra_len = (int)STRLEN(p_extra); saved_char = *p_extra; *p_extra = NUL; } u_clearline(); // cannot do "U" command when adding lines -#ifdef FEAT_SMARTINDENT did_si = FALSE; -#endif ai_col = 0; // If we just did an auto-indent, then we didn't type anything on @@ -1479,11 +1469,7 @@ open_line( // If 'autoindent' and/or 'smartindent' is set, try to figure out what // indent to use for the new line. - if (curbuf->b_p_ai -#ifdef FEAT_SMARTINDENT - || do_si -#endif - ) + if (curbuf->b_p_ai || do_si) { // count white space on current line #ifdef FEAT_VARTABS @@ -1495,7 +1481,6 @@ open_line( if (newindent == 0 && !(flags & OPENLINE_COM_LIST)) newindent = second_line_indent; // for ^^D command in insert mode -#ifdef FEAT_SMARTINDENT // Do smart indenting. // In insert/replace mode (only when dir == FORWARD) // we may move some text to the next line. If it starts with '{' @@ -1636,22 +1621,19 @@ open_line( } if (do_si) can_si = TRUE; -#endif // FEAT_SMARTINDENT did_ai = TRUE; } -#ifdef FEAT_CINDENT // May do indenting after opening a new line. do_cindent = !p_paste && (curbuf->b_p_cin -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL || *curbuf->b_p_inde != NUL -# endif +#endif ) && in_cinkeys(dir == FORWARD ? KEY_OPEN_FORW : KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum)); -#endif // Find out if the current line starts with a comment leader. // This may then be inserted in front of the new line. @@ -1660,7 +1642,6 @@ open_line( { lead_len = get_leader_len(saved_line, &lead_flags, dir == BACKWARD, TRUE); -#ifdef FEAT_CINDENT if (lead_len == 0 && curbuf->b_p_cin && do_cindent && dir == FORWARD && !has_format_option(FO_NO_OPEN_COMS)) { @@ -1678,7 +1659,6 @@ open_line( } } } -#endif } else lead_len = 0; @@ -1984,11 +1964,7 @@ open_line( } // Recompute the indent, it may have changed. - if (curbuf->b_p_ai -#ifdef FEAT_SMARTINDENT - || do_si -#endif - ) + if (curbuf->b_p_ai || do_si) #ifdef FEAT_VARTABS newindent = get_indent_str_vtab(leader, curbuf->b_p_ts, curbuf->b_p_vts_array, FALSE); @@ -2035,11 +2011,7 @@ open_line( // if a new indent will be set below, remove the indent that // is in the comment leader - if (newindent -#ifdef FEAT_SMARTINDENT - || did_si -#endif - ) + if (newindent || did_si) { while (lead_len && VIM_ISWHITE(*leader)) { @@ -2050,9 +2022,7 @@ open_line( } } -#ifdef FEAT_SMARTINDENT did_si = can_si = FALSE; -#endif } else if (comment_end != NULL) { @@ -2061,11 +2031,7 @@ open_line( // indent to align with the line containing the start of the // comment. if (comment_end[0] == '*' && comment_end[1] == '/' && - (curbuf->b_p_ai -#ifdef FEAT_SMARTINDENT - || do_si -#endif - )) + (curbuf->b_p_ai || do_si)) { old_cursor = curwin->w_cursor; curwin->w_cursor.col = (colnr_T)(comment_end - saved_line); @@ -2182,14 +2148,9 @@ open_line( did_append = FALSE; } - if (newindent -#ifdef FEAT_SMARTINDENT - || did_si -#endif - ) + if (newindent || did_si) { ++curwin->w_cursor.lnum; -#ifdef FEAT_SMARTINDENT if (did_si) { int sw = (int)get_sw_value(curbuf); @@ -2198,7 +2159,6 @@ open_line( newindent -= newindent % sw; newindent += sw; } -#endif // Copy the indent if (curbuf->b_p_ci) { @@ -2221,10 +2181,8 @@ open_line( for (n = 0; n < (int)curwin->w_cursor.col; ++n) replace_push(NUL); newcol += curwin->w_cursor.col; -#ifdef FEAT_SMARTINDENT if (no_si) did_si = FALSE; -#endif } // In MODE_REPLACE state, for each character in the extra leader, there @@ -2278,7 +2236,6 @@ open_line( curwin->w_cursor.col = newcol; curwin->w_cursor.coladd = 0; -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) // In MODE_VREPLACE state, we are handling the replace stack ourselves, so // stop fixthisline() from doing it (via change_indent()) by telling it // we're in normal MODE_INSERT state. @@ -2289,8 +2246,7 @@ open_line( } else vreplace_mode = 0; -#endif -#ifdef FEAT_LISP + // May do lisp indenting. if (!p_paste && leader == NULL @@ -2300,19 +2256,16 @@ open_line( fixthisline(get_lisp_indent); ai_col = (colnr_T)getwhitecols_curline(); } -#endif -#ifdef FEAT_CINDENT + // May do indenting after opening a new line. if (do_cindent) { do_c_expr_indent(); ai_col = (colnr_T)getwhitecols_curline(); } -#endif -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) + if (vreplace_mode != 0) State = vreplace_mode; -#endif // Finally, MODE_VREPLACE gets the stuff on the new line, then puts back // the original line, and inserts the new stuff char by char, pushing old diff --git a/src/charset.c b/src/charset.c index 6fd8b6b54f..34751e1862 100644 --- a/src/charset.c +++ b/src/charset.c @@ -129,13 +129,11 @@ buf_init_chartab( SET_CHARTAB(buf, c); } -#ifdef FEAT_LISP /* * In lisp mode the '-' character is included in keywords. */ if (buf->b_p_lisp) SET_CHARTAB(buf, '-'); -#endif // Walk through the 'isident', 'iskeyword', 'isfname' and 'isprint' // options Each option is a list of characters, character numbers or diff --git a/src/cindent.c b/src/cindent.c index 2d47e641be..27e8a7b276 100644 --- a/src/cindent.c +++ b/src/cindent.c @@ -32,7 +32,6 @@ #define LOOKFOR_JS_KEY 11 #define LOOKFOR_COMMA 12 -#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT) /* * Return TRUE if the string "line" starts with a word from 'cinwords'. */ @@ -64,7 +63,6 @@ cin_is_cinword(char_u *line) } return retval; } -#endif /* * Skip to the end of a "string" and a 'c' character. @@ -148,8 +146,6 @@ is_pos_in_string(char_u *line, colnr_T col) return !((colnr_T)(p - line) <= col); } -#if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL) - /* * Find the start of a comment, not knowing if we are in a comment right now. * Search starts at w_cursor.lnum and goes backwards. @@ -254,9 +250,7 @@ ind_find_start_CORS(linenr_T *is_raw) // XXX } return comment_pos; } -#endif // FEAT_CINDENT || FEAT_SYN_HL -#if defined(FEAT_CINDENT) || defined(PROTO) /* * Return TRUE if C-indenting is on. @@ -265,9 +259,9 @@ ind_find_start_CORS(linenr_T *is_raw) // XXX cindent_on(void) { return (!p_paste && (curbuf->b_p_cin -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL || *curbuf->b_p_inde != NUL -# endif +#endif )); } @@ -4151,7 +4145,6 @@ do_c_expr_indent(void) # endif fixthisline(get_c_indent); } -#endif #if defined(FEAT_EVAL) || defined(PROTO) /* @@ -4160,7 +4153,6 @@ do_c_expr_indent(void) void f_cindent(typval_T *argvars UNUSED, typval_T *rettv) { -# ifdef FEAT_CINDENT pos_T pos; linenr_T lnum; @@ -4176,7 +4168,6 @@ f_cindent(typval_T *argvars UNUSED, typval_T *rettv) curwin->w_cursor = pos; } else -# endif rettv->vval.v_number = -1; } #endif diff --git a/src/edit.c b/src/edit.c index 6e76971c35..939aeb9d66 100644 --- a/src/edit.c +++ b/src/edit.c @@ -84,9 +84,7 @@ static int last_insert_skip; // nr of chars in front of previous insert static int new_insert_skip; // nr of chars in front of current insert static int did_restart_edit; // "restart_edit" when calling edit() -#ifdef FEAT_CINDENT static int can_cindent; // may do cindenting on this line -#endif #ifdef FEAT_RIGHTLEFT static int revins_on; // reverse insert mode on @@ -134,9 +132,7 @@ edit( static linenr_T o_lnum = 0; int i; int did_backspace = TRUE; // previous char was backspace -#ifdef FEAT_CINDENT int line_is_white = FALSE; // line is empty before insert -#endif linenr_T old_topline = 0; // topline before insertion #ifdef FEAT_DIFF int old_topfill = -1; @@ -387,9 +383,7 @@ edit( ins_need_undo = TRUE; where_paste_started.lnum = 0; -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif #ifdef FEAT_FOLDING // The cursor line is not in a closed fold, unless 'insertmode' is set or // restarting. @@ -742,7 +736,6 @@ edit( continue; } -#ifdef FEAT_CINDENT if (cindent_on() && ctrl_x_mode_none()) { // A key name preceded by a bang means this key is not to be @@ -756,7 +749,6 @@ edit( && stop_arrow() == OK) do_c_expr_indent(); } -#endif #ifdef FEAT_RIGHTLEFT if (curwin->w_p_rl) @@ -1294,9 +1286,7 @@ docomplete: disable_fold_update--; #endif compl_busy = FALSE; -#ifdef FEAT_SMARTINDENT can_si = may_do_si(); // allow smartindenting -#endif break; case Ctrl_Y: // copy from previous line or scroll down @@ -1346,18 +1336,14 @@ normalchar: break; } #endif -#ifdef FEAT_SMARTINDENT // Try to perform smart-indenting. ins_try_si(c); -#endif if (c == ' ') { inserted_space = TRUE; -#ifdef FEAT_CINDENT if (inindent(0)) can_cindent = FALSE; -#endif if (Insstart_blank_vcol == MAXCOL && curwin->w_cursor.lnum == Insstart.lnum) Insstart_blank_vcol = get_nolist_virtcol(); @@ -1402,7 +1388,6 @@ normalchar: if (arrow_used) inserted_space = FALSE; -#ifdef FEAT_CINDENT if (can_cindent && cindent_on() && ctrl_x_mode_normal()) { force_cindent: @@ -1416,7 +1401,6 @@ force_cindent: do_c_expr_indent(); } } -#endif // FEAT_CINDENT } // for (;;) // NOTREACHED @@ -2194,11 +2178,9 @@ insertchar( end_comment_pending = NUL; did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif /* * If there's any pending input, grab up to INPUT_BUFLEN at once. @@ -2220,9 +2202,7 @@ insertchar( && !has_insertcharpre() && vpeekc() != NUL && !(State & REPLACE_FLAG) -#ifdef FEAT_CINDENT && !cindent_on() -#endif #ifdef FEAT_RIGHTLEFT && !p_ri #endif @@ -2546,11 +2526,9 @@ stop_insert( } } did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif // Set '[ and '] to the inserted text. When end_insert_pos is NULL we are // now in a different buffer. @@ -3898,14 +3876,10 @@ ins_shift(int c, int lastc) if (did_ai && *skipwhite(ml_get_curline()) != NUL) did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif -#ifdef FEAT_CINDENT can_cindent = FALSE; // no cindenting after ^D or ^T -#endif } static void @@ -3935,11 +3909,9 @@ ins_del(void) else if (del_char(FALSE) == FAIL) // delete char under cursor vim_beep(BO_BS); did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif AppendCharToRedobuff(K_DEL); } @@ -3982,9 +3954,7 @@ ins_bs( int in_indent; int oldState; int cpc[MAX_MCO]; // composing characters -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) int call_fix_indent = FALSE; -#endif /* * can't delete anything in an empty file @@ -4016,10 +3986,8 @@ ins_bs( if (stop_arrow() == FAIL) return FALSE; in_indent = inindent(0); -#ifdef FEAT_CINDENT if (in_indent) can_cindent = FALSE; -#endif end_comment_pending = NUL; // After BS, don't auto-end comment #ifdef FEAT_RIGHTLEFT if (revins_on) // put cursor after last inserted char @@ -4153,11 +4121,7 @@ ins_bs( mincol = 0; // keep indent if (mode == BACKSPACE_LINE - && (curbuf->b_p_ai -#ifdef FEAT_CINDENT - || cindent_on() -#endif - ) + && (curbuf->b_p_ai || cindent_on()) #ifdef FEAT_RIGHTLEFT && !revins_on #endif @@ -4168,10 +4132,8 @@ ins_bs( if (curwin->w_cursor.col < save_col) { mincol = curwin->w_cursor.col; -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) // should now fix the indent to match with the previous line call_fix_indent = TRUE; -#endif } curwin->w_cursor.col = save_col; } @@ -4337,18 +4299,14 @@ ins_bs( } did_backspace = TRUE; } -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif if (curwin->w_cursor.col <= 1) did_ai = FALSE; -#if defined(FEAT_LISP) || defined(FEAT_CINDENT) if (call_fix_indent) fix_indent(); -#endif /* * It's a little strange to put backspaces into the redo @@ -4497,9 +4455,7 @@ ins_tabline(int c) { undisplay_dollar(); start_arrow(&curwin->w_cursor); -# ifdef FEAT_CINDENT can_cindent = TRUE; -# endif } if (c == K_TABLINE) @@ -4523,9 +4479,7 @@ ins_scroll(void) if (gui_do_scroll()) { start_arrow(&tpos); -# ifdef FEAT_CINDENT can_cindent = TRUE; -# endif } } @@ -4539,9 +4493,7 @@ ins_horscroll(void) if (gui_do_horiz_scroll(scrollbar_value, FALSE)) { start_arrow(&tpos); -# ifdef FEAT_CINDENT can_cindent = TRUE; -# endif } } #endif @@ -4748,9 +4700,7 @@ ins_up( ) redraw_later(VALID); start_arrow(&tpos); -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif } else vim_beep(BO_CRSR); @@ -4778,9 +4728,7 @@ ins_pageup(void) if (onepage(BACKWARD, 1L) == OK) { start_arrow(&tpos); -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif } else vim_beep(BO_CRSR); @@ -4809,9 +4757,7 @@ ins_down( ) redraw_later(VALID); start_arrow(&tpos); -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif } else vim_beep(BO_CRSR); @@ -4839,9 +4785,7 @@ ins_pagedown(void) if (onepage(FORWARD, 1L) == OK) { start_arrow(&tpos); -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif } else vim_beep(BO_CRSR); @@ -4872,10 +4816,8 @@ ins_tab(void) return FALSE; ind = inindent(0); -#ifdef FEAT_CINDENT if (ind) can_cindent = FALSE; -#endif /* * When nothing special, insert TAB like a normal character. @@ -4901,11 +4843,9 @@ ins_tab(void) return TRUE; did_ai = FALSE; -#ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; -#endif AppendToRedobuff((char_u *)"\t"); #ifdef FEAT_VARTABS @@ -5173,9 +5113,7 @@ ins_eol(int c) has_format_option(FO_RET_COMS) ? OPENLINE_DO_COM : 0, old_indent, NULL); old_indent = 0; -#ifdef FEAT_CINDENT can_cindent = TRUE; -#endif #ifdef FEAT_FOLDING // When inserting a line the cursor line must never be in a closed fold. foldOpenCursor(); @@ -5427,7 +5365,6 @@ do_insert_char_pre(int c) } #endif -#if defined(FEAT_CINDENT) || defined(PROTO) int get_can_cindent(void) { @@ -5439,7 +5376,6 @@ set_can_cindent(int val) { can_cindent = val; } -#endif /* * Trigger "event" and take care of fixing undo. diff --git a/src/evalfunc.c b/src/evalfunc.c index 35b8984c3c..6abd53a73e 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -5476,13 +5476,7 @@ f_has(typval_T *argvars, typval_T *rettv) 0 #endif }, - {"cindent", -#ifdef FEAT_CINDENT - 1 -#else - 0 -#endif - }, + {"cindent", 1}, {"clientserver", #ifdef FEAT_CLIENTSERVER 1 @@ -5796,13 +5790,7 @@ f_has(typval_T *argvars, typval_T *rettv) 0 #endif }, - {"lispindent", -#ifdef FEAT_LISP - 1 -#else - 0 -#endif - }, + {"lispindent", 1}, {"listcmds", 1}, {"localmap", 1}, {"lua", @@ -6091,13 +6079,7 @@ f_has(typval_T *argvars, typval_T *rettv) 0 #endif }, - {"smartindent", -#ifdef FEAT_SMARTINDENT - 1 -#else - 0 -#endif - }, + {"smartindent", 1}, {"startuptime", #ifdef STARTUPTIME 1 diff --git a/src/feature.h b/src/feature.h index 1a24879816..b02bb9c554 100644 --- a/src/feature.h +++ b/src/feature.h @@ -111,6 +111,9 @@ * +comments 'comments' option. * +title 'title' and 'icon' options * +jumplist Jumplist, CTRL-O and CTRL-I commands. + * +lispindent lisp indenting (From Eric Fischer). + * +cindent C code indenting (From Eric Fischer). + * +smartindent smart C code indenting when the 'si' option is set. * * Obsolete: * +tag_old_static Old style static tags: "file:tag file ..". @@ -432,25 +435,6 @@ #endif /* - * +lispindent lisp indenting (From Eric Fischer). - * +cindent C code indenting (From Eric Fischer). - * +smartindent smart C code indenting when the 'si' option is set. - * - * These two need to be defined when making prototypes. - */ -#if defined(FEAT_NORMAL) || defined(PROTO) -# define FEAT_LISP -#endif - -#if defined(FEAT_NORMAL) || defined(PROTO) -# define FEAT_CINDENT -#endif - -#ifdef FEAT_NORMAL -# define FEAT_SMARTINDENT -#endif - -/* * +cryptv Encryption (by Mohsin Ahmed <mosh@sasi.com>). */ #if defined(FEAT_NORMAL) && !defined(FEAT_CRYPT) || defined(PROTO) diff --git a/src/globals.h b/src/globals.h index 52b4c053f0..bf098fdedb 100644 --- a/src/globals.h +++ b/src/globals.h @@ -937,7 +937,6 @@ EXTERN int end_comment_pending INIT(= NUL); */ EXTERN int did_syncbind INIT(= FALSE); -#ifdef FEAT_SMARTINDENT /* |