To: vim_dev@googlegroups.com Subject: Patch 8.2.4993 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4993 Problem: smart/C/lisp indenting is optional, which makes the code more complex, while it only reduces the executable size a bit. Solution: Graduate FEAT_CINDENT, FEAT_SMARTINDENT and FEAT_LISP. Files: runtime/doc/builtin.txt, runtime/doc/indent.txt, runtime/doc/options.txt, runtime/doc/various.txt, src/feature.h, src/buffer.c, src/change.c, src/cindent.c, src/charset.c, src/edit.c, src/evalfunc.c, src/indent.c, src/insexpand.c, src/main.c, src/mouse.c, src/ops.c, src/option.c, src/optionstr.c, src/register.c, src/search.c, src/textformat.c, src/version.c, src/option.h, src/optiondefs.h, src/structs.h, src/globals.h, src/testdir/test_edit.vim *** ../vim-8.2.4992/runtime/doc/builtin.txt 2022-05-19 10:31:06.965630508 +0100 --- runtime/doc/builtin.txt 2022-05-21 19:52:39.628899314 +0100 *************** *** 1500,1507 **** 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. See |C-indenting|. Can also be used as a |method|: > --- 1500,1506 ---- 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 -1 is returned. See |C-indenting|. Can also be used as a |method|: > *************** *** 5154,5161 **** 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 error is given. Can also be used as a |method|: > --- 5172,5178 ---- 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 -1 is returned. In |Vim9| script an error is given. Can also be used as a |method|: > *** ../vim-8.2.4992/runtime/doc/indent.txt 2022-04-07 12:39:03.979973945 +0100 --- runtime/doc/indent.txt 2022-05-21 19:49:06.106361376 +0100 *************** *** 22,30 **** 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. --- 22,27 ---- *** ../vim-8.2.4992/runtime/doc/options.txt 2022-05-07 14:09:14.708852889 +0100 --- runtime/doc/options.txt 2022-05-21 19:51:50.005206019 +0100 *************** *** 1599,1615 **** Note that v:fname_in and v:fname_out will never be the same. Note that v:charconvert_from and v:charconvert_to may be different from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4. Encryption is not done by Vim when using 'charconvert'. If you want to encrypt the file after conversion, 'charconvert' should take care of this. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'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. --- 1603,1626 ---- Note that v:fname_in and v:fname_out will never be the same. Note that v:charconvert_from and v:charconvert_to may be different from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4. + Encryption is not done by Vim when using 'charconvert'. If you want to encrypt the file after conversion, 'charconvert' should take care of this. + + If the 'charconvert' expression starts with s: or ||, then it is + replaced with the script ID (|local-function|). Example: > + set charconvert=s:MyConvert() + set charconvert=SomeConvert() + < Otherwise the expression is evaluated in the context of the script + where the option was set, thus script-local items are available. + This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'cindent'* *'cin'* *'nocindent'* *'nocin'* 'cindent' 'cin' boolean (default off) local to buffer 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. *************** *** 1626,1633 **** *'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. --- 1637,1642 ---- *************** *** 1637,1644 **** *'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. --- 1646,1651 ---- *************** *** 1647,1654 **** *'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 {}). --- 1654,1659 ---- *************** *** 1659,1666 **** *'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": > --- 1664,1669 ---- *************** *** 1773,1779 **** local to window {not available when compiled without the |+syntax| feature} ! 'colorcolumn' is a comma separated list of screen columns that are highlighted with ColorColumn |hl-ColorColumn|. Useful to align text. Will make screen redrawing slower. The screen column can be an absolute number, or a number preceded with --- 1776,1782 ---- local to window {not available when compiled without the |+syntax| feature} ! 'colorcolumn' is a comma-separated list of screen columns that are highlighted with ColorColumn |hl-ColorColumn|. Useful to align text. Will make screen redrawing slower. The screen column can be an absolute number, or a number preceded with *************** *** 4554,4561 **** *'indentexpr'* *'inde'* 'indentexpr' 'inde' string (default "") local to buffer ! {not available when compiled without the |+cindent| ! or |+eval| features} 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. --- 4568,4575 ---- *'indentexpr'* *'inde'* 'indentexpr' 'inde' string (default "") local to buffer ! {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. *************** *** 4597,4604 **** *'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|. --- 4614,4619 ---- *************** *** 4986,4993 **** *'lisp'* *'nolisp'* 'lisp' boolean (default off) local to buffer - {not available when compiled without the |+lispindent| - feature} Lisp mode: When 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' --- 5001,5006 ---- *************** *** 5001,5009 **** *'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'| *'list'* *'nolist'* --- 5014,5020 ---- *'lispwords'* *'lw'* 'lispwords' 'lw' string (default is very long) global or local to buffer |global-local| ! Comma-separated list of words that influence the Lisp indenting. |'lisp'| *'list'* *'nolist'* *************** *** 7190,7197 **** *'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, --- 7206,7211 ---- *************** *** 7287,7293 **** commands. It must end in ".{encoding}.add". You need to include the path, otherwise the file is placed in the current directory. *E765* ! It may also be a comma separated list of names. A count before the |zg| and |zw| commands can be used to access each. This allows using a personal word list file and a project word list file. When a word is added while this option is empty Vim will set it for --- 7301,7307 ---- commands. It must end in ".{encoding}.add". You need to include the path, otherwise the file is placed in the current directory. *E765* ! It may also be a comma-separated list of names. A count before the |zg| and |zw| commands can be used to access each. This allows using a personal word list file and a project word list file. When a word is added while this option is empty Vim will set it for *** ../vim-8.2.4992/runtime/doc/various.txt 2022-02-23 18:07:34.357915001 +0000 --- runtime/doc/various.txt 2022-05-21 19:51:11.633455795 +0100 *************** *** 345,351 **** 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 N *+clientserver* Unix and Win32: Remote invocation |clientserver| *+clipboard* |clipboard| support compiled-in *+clipboard_working* |clipboard| support compiled-in and working --- 346,352 ---- N *+byte_offset* support for 'o' flag in 'statusline' option, "go" and ":goto" commands. m *+channel* inter process communication |channel| ! 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 *************** *** 397,403 **** B *+langmap* |'langmap'| N *+libcall* |libcall()| N *+linebreak* |'linebreak'|, |'breakat'| and |'showbreak'| ! N *+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| --- 398,404 ---- B *+langmap* |'langmap'| N *+libcall* |libcall()| N *+linebreak* |'linebreak'|, |'breakat'| and |'showbreak'| ! 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| *************** *** 449,455 **** m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn| T *+scrollbind* |'scrollbind'| B *+signs* |:sign| ! N *+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| --- 450,456 ---- m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn| T *+scrollbind* |'scrollbind'| B *+signs* |:sign| ! 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| *** ../vim-8.2.4992/src/feature.h 2022-04-03 18:01:39.655574461 +0100 --- src/feature.h 2022-05-21 19:39:11.525043955 +0100 *************** *** 111,116 **** --- 111,119 ---- * +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,456 **** #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 ). */ #if defined(FEAT_NORMAL) && !defined(FEAT_CRYPT) || defined(PROTO) --- 435,440 ---- *** ../vim-8.2.4992/src/buffer.c 2022-05-15 14:50:08.738042956 +0100 --- src/buffer.c 2022-05-21 19:35:20.569232853 +0100 *************** *** 290,298 **** 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. --- 290,296 ---- *************** *** 2274,2280 **** clear_string_option(&buf->b_p_inex); # endif #endif ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) clear_string_option(&buf->b_p_inde); clear_string_option(&buf->b_p_indk); #endif --- 2272,2278 ---- clear_string_option(&buf->b_p_inex); # endif #endif ! #if defined(FEAT_EVAL) clear_string_option(&buf->b_p_inde); clear_string_option(&buf->b_p_indk); #endif *************** *** 2335,2348 **** 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); --- 2333,2342 ---- *************** *** 2372,2380 **** #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); } --- 2366,2372 ---- *** ../vim-8.2.4992/src/change.c 2022-05-21 11:20:38.102070988 +0100 --- src/change.c 2022-05-21 19:31:35.785408643 +0100 *************** *** 1397,1413 **** 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 --- 1397,1407 ---- *************** *** 1453,1474 **** 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 --- 1447,1464 ---- *************** *** 1479,1489 **** // 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 ! ) { // count white space on current line #ifdef FEAT_VARTABS --- 1469,1475 ---- // If 'autoindent' and/or 'smartindent' is set, try to figure out what // indent to use for the new line. ! if (curbuf->b_p_ai || do_si) { // count white space on current line #ifdef FEAT_VARTABS *************** *** 1495,1501 **** 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 '{' --- 1481,1486 ---- *************** *** 1636,1657 **** } 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 || *curbuf->b_p_inde != NUL ! # 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. --- 1621,1639 ---- } if (do_si) can_si = TRUE; did_ai = TRUE; } // May do indenting after opening a new line. do_cindent = !p_paste && (curbuf->b_p_cin ! #ifdef FEAT_EVAL || *curbuf->b_p_inde != NUL ! #endif ) && in_cinkeys(dir == FORWARD ? KEY_OPEN_FORW : KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum)); // Find out if the current line starts with a comment leader. // This may then be inserted in front of the new line. *************** *** 1660,1666 **** { 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)) { --- 1642,1647 ---- *************** *** 1678,1684 **** } } } - #endif } else lead_len = 0; --- 1659,1664 ---- *************** *** 1984,1994 **** } // Recompute the indent, it may have changed. ! if (curbuf->b_p_ai ! #ifdef FEAT_SMARTINDENT ! || do_si ! #endif ! ) #ifdef FEAT_VARTABS newindent = get_indent_str_vtab(leader, curbuf->b_p_ts, curbuf->b_p_vts_array, FALSE); --- 1964,1970 ---- } // Recompute the indent, it may have changed. ! 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,2045 **** // 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 ! ) { while (lead_len && VIM_ISWHITE(*leader)) { --- 2011,2017 ---- // if a new indent will be set below, remove the indent that // is in the comment leader ! if (newindent || did_si) { while (lead_len && VIM_ISWHITE(*leader)) { *************** *** 2050,2058 **** } } - #ifdef FEAT_SMARTINDENT did_si = can_si = FALSE; - #endif } else if (comment_end != NULL) { --- 2022,2028 ---- *************** *** 2061,2071 **** // 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 ! )) { old_cursor = curwin->w_cursor; curwin->w_cursor.col = (colnr_T)(comment_end - saved_line); --- 2031,2037 ---- // indent to align with the line containing the start of the // comment. if (comment_end[0] == '*' && comment_end[1] == '/' && ! (curbuf->b_p_ai || do_si)) { old_cursor = curwin->w_cursor; curwin->w_cursor.col = (colnr_T)(comment_end - saved_line); *************** *** 2182,2195 **** did_append = FALSE; } ! if (newindent ! #ifdef FEAT_SMARTINDENT ! || did_si ! #endif ! ) { ++curwin->w_cursor.lnum; - #ifdef FEAT_SMARTINDENT if (did_si) { int sw = (int)get_sw_value(curbuf); --- 2148,2156 ---- did_append = FALSE; } ! if (newindent || did_si) { ++curwin->w_cursor.lnum; if (did_si) { int sw = (int)get_sw_value(curbuf); *************** *** 2198,2204 **** newindent -= newindent % sw; newindent += sw; } - #endif // Copy the indent if (curbuf->b_p_ci) { --- 2159,2164 ---- *************** *** 2221,2230 **** 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 --- 2181,2188 ---- *************** *** 2278,2284 **** 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. --- 2236,2241 ---- *************** *** 2289,2296 **** } else vreplace_mode = 0; ! #endif ! #ifdef FEAT_LISP // May do lisp indenting. if (!p_paste && leader == NULL --- 2246,2252 ---- } else vreplace_mode = 0; ! // May do lisp indenting. if (!p_paste && leader == NULL *************** *** 2300,2318 **** 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 --- 2256,2271 ---- fixthisline(get_lisp_indent); ai_col = (colnr_T)getwhitecols_curline(); } ! // May do indenting after opening a new line. if (do_cindent) { do_c_expr_indent(); ai_col = (colnr_T)getwhitecols_curline(); } ! if (vreplace_mode != 0) State = vreplace_mode; // 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 *** ../vim-8.2.4992/src/cindent.c 2022-05-16 18:06:12.035283526 +0100 --- src/cindent.c 2022-05-21 19:11:25.873865379 +0100 *************** *** 32,38 **** #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'. */ --- 32,37 ---- *************** *** 64,70 **** } return retval; } - #endif /* * Skip to the end of a "string" and a 'c' character. --- 63,68 ---- *************** *** 148,155 **** 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. --- 146,151 ---- *************** *** 254,262 **** } return comment_pos; } - #endif // FEAT_CINDENT || FEAT_SYN_HL - #if defined(FEAT_CINDENT) || defined(PROTO) /* * Return TRUE if C-indenting is on. --- 250,256 ---- *************** *** 265,273 **** cindent_on(void) { return (!p_paste && (curbuf->b_p_cin ! # ifdef FEAT_EVAL || *curbuf->b_p_inde != NUL ! # endif )); } --- 259,267 ---- cindent_on(void) { return (!p_paste && (curbuf->b_p_cin ! #ifdef FEAT_EVAL || *curbuf->b_p_inde != NUL ! #endif )); } *************** *** 4151,4157 **** # endif fixthisline(get_c_indent); } - #endif #if defined(FEAT_EVAL) || defined(PROTO) /* --- 4145,4150 ---- *************** *** 4160,4166 **** void f_cindent(typval_T *argvars UNUSED, typval_T *rettv) { - # ifdef FEAT_CINDENT pos_T pos; linenr_T lnum; --- 4153,4158 ---- *************** *** 4176,4182 **** curwin->w_cursor = pos; } else - # endif rettv->vval.v_number = -1; } #endif --- 4168,4173 ---- *** ../vim-8.2.4992/src/charset.c 2022-05-07 20:01:10.050731702 +0100 --- src/charset.c 2022-05-21 19:35:38.129218743 +0100 *************** *** 129,141 **** 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 --- 129,139 ---- *** ../vim-8.2.4992/src/edit.c 2022-05-16 19:40:54.757799730 +0100 --- src/edit.c 2022-05-21 19:32:04.013387124 +0100 *************** *** 84,92 **** 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 --- 84,90 ---- *************** *** 134,142 **** 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; --- 132,138 ---- *************** *** 387,395 **** 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. --- 383,389 ---- *************** *** 742,748 **** 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 --- 736,741 ---- *************** *** 756,762 **** && stop_arrow() == OK) do_c_expr_indent(); } - #endif #ifdef FEAT_RIGHTLEFT if (curwin->w_p_rl) --- 749,754 ---- *************** *** 1294,1302 **** 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 --- 1286,1292 ---- *************** *** 1346,1363 **** 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(); --- 1336,1349 ---- *************** *** 1402,1408 **** if (arrow_used) inserted_space = FALSE; - #ifdef FEAT_CINDENT if (can_cindent && cindent_on() && ctrl_x_mode_normal()) { force_cindent: --- 1388,1393 ---- *************** *** 1416,1422 **** do_c_expr_indent(); } } - #endif // FEAT_CINDENT } // for (;;) // NOTREACHED --- 1401,1406 ---- *************** *** 2194,2204 **** 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. --- 2178,2186 ---- *************** *** 2220,2228 **** && !has_insertcharpre() && vpeekc() != NUL && !(State & REPLACE_FLAG) - #ifdef FEAT_CINDENT && !cindent_on() - #endif #ifdef FEAT_RIGHTLEFT && !p_ri #endif --- 2202,2208 ---- *************** *** 2546,2556 **** } } 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. --- 2526,2534 ---- *************** *** 3898,3911 **** 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 --- 3876,3885 ---- *************** *** 3935,3945 **** 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); } --- 3909,3917 ---- *************** *** 3982,3990 **** 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 --- 3954,3960 ---- *************** *** 4016,4025 **** 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 --- 3986,3993 ---- *************** *** 4153,4163 **** mincol = 0; // keep indent if (mode == BACKSPACE_LINE ! && (curbuf->b_p_ai ! #ifdef FEAT_CINDENT ! || cindent_on() ! #endif ! ) #ifdef FEAT_RIGHTLEFT && !revins_on #endif --- 4121,4127 ---- mincol = 0; // keep indent if (mode == BACKSPACE_LINE ! && (curbuf->b_p_ai || cindent_on()) #ifdef FEAT_RIGHTLEFT && !revins_on #endif *************** *** 4168,4177 **** 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; } --- 4132,4139 ---- *************** *** 4337,4354 **** } 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 --- 4299,4312 ---- *************** *** 4497,4505 **** { undisplay_dollar(); start_arrow(&curwin->w_cursor); - # ifdef FEAT_CINDENT can_cindent = TRUE; - # endif } if (c == K_TABLINE) --- 4455,4461 ---- *************** *** 4523,4531 **** if (gui_do_scroll()) { start_arrow(&tpos); - # ifdef FEAT_CINDENT can_cindent = TRUE; - # endif } } --- 4479,4485 ---- *************** *** 4539,4547 **** if (gui_do_horiz_scroll(scrollbar_value, FALSE)) { start_arrow(&tpos); - # ifdef FEAT_CINDENT can_cindent = TRUE; - # endif } } #endif --- 4493,4499 ---- *************** *** 4748,4756 **** ) redraw_later(VALID); start_arrow(&tpos); - #ifdef FEAT_CINDENT can_cindent = TRUE; - #endif } else vim_beep(BO_CRSR); --- 4700,4706 ---- *************** *** 4778,4786 **** if (onepage(BACKWARD, 1L) == OK) { start_arrow(&tpos); - #ifdef FEAT_CINDENT can_cindent = TRUE; - #endif } else vim_beep(BO_CRSR); --- 4728,4734 ---- *************** *** 4809,4817 **** ) redraw_later(VALID); start_arrow(&tpos); - #ifdef FEAT_CINDENT can_cindent = TRUE; - #endif } else vim_beep(BO_CRSR); --- 4757,4763 ---- *************** *** 4839,4847 **** if (onepage(FORWARD, 1L) == OK) { start_arrow(&tpos); - #ifdef FEAT_CINDENT can_cindent = TRUE; - #endif } else vim_beep(BO_CRSR); --- 4785,4791 ---- *************** *** 4872,4881 **** return FALSE; ind = inindent(0); - #ifdef FEAT_CINDENT if (ind) can_cindent = FALSE; - #endif /* * When nothing special, insert TAB like a normal character. --- 4816,4823 ---- *************** *** 4901,4911 **** 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 --- 4843,4851 ---- *************** *** 5173,5181 **** 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(); --- 5113,5119 ---- *************** *** 5427,5433 **** } #endif - #if defined(FEAT_CINDENT) || defined(PROTO) int get_can_cindent(void) { --- 5365,5370 ---- *************** *** 5439,5445 **** { can_cindent = val; } - #endif /* * Trigger "event" and take care of fixing undo. --- 5376,5381 ---- *** ../vim-8.2.4992/src/evalfunc.c 2022-05-19 10:31:06.969630503 +0100 --- src/evalfunc.c 2022-05-21 19:35:47.277211371 +0100 *************** *** 5476,5488 **** 0 #endif }, ! {"cindent", ! #ifdef FEAT_CINDENT ! 1 ! #else ! 0 ! #endif ! }, {"clientserver", #ifdef FEAT_CLIENTSERVER 1 --- 5476,5482 ---- 0 #endif }, ! {"cindent", 1}, {"clientserver", #ifdef FEAT_CLIENTSERVER 1 *************** *** 5796,5808 **** 0 #endif }, ! {"lispindent", ! #ifdef FEAT_LISP ! 1 ! #else ! 0 ! #endif ! }, {"listcmds", 1}, {"localmap", 1}, {"lua", --- 5790,5796 ---- 0 #endif }, ! {"lispindent", 1}, {"listcmds", 1}, {"localmap", 1}, {"lua", *************** *** 6091,6103 **** 0 #endif }, ! {"smartindent", ! #ifdef FEAT_SMARTINDENT ! 1 ! #else ! 0 ! #endif ! }, {"startuptime", #ifdef STARTUPTIME 1 --- 6079,6085 ---- 0 #endif }, ! {"smartindent", 1}, {"startuptime", #ifdef STARTUPTIME 1 *** ../vim-8.2.4992/src/indent.c 2022-05-14 12:54:18.643640552 +0100 --- src/indent.c 2022-05-21 19:36:06.121196147 +0100 *************** *** 1055,1061 **** return FALSE; } - #if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(PROTO) /* * op_reindent - handle reindenting a block of lines. */ --- 1055,1060 ---- *************** *** 1092,1101 **** // Be vi-compatible: For lisp indenting the first line is not // indented, unless there is only one line. - # ifdef FEAT_LISP if (i != oap->line_count - 1 || oap->line_count == 1 || how != get_lisp_indent) - # endif { l = skipwhite(ml_get_curline()); if (*l == NUL) // empty or blank line --- 1091,1098 ---- *************** *** 1142,1150 **** curbuf->b_op_end = oap->end; } } - #endif // defined(FEAT_LISP) || defined(FEAT_CINDENT) - #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) || defined(PROTO) /* * Return TRUE if lines starting with '#' should be left aligned. */ --- 1139,1145 ---- *************** *** 1152,1173 **** preprocs_left(void) { return - # ifdef FEAT_SMARTINDENT - # ifdef FEAT_CINDENT (curbuf->b_p_si && !curbuf->b_p_cin) || - # else - curbuf->b_p_si - # endif - # endif - # ifdef FEAT_CINDENT (curbuf->b_p_cin && in_cinkeys('#', ' ', TRUE) && curbuf->b_ind_hash_comment == 0) - # endif ; } - #endif - #ifdef FEAT_SMARTINDENT /* * Return TRUE if the conditions are OK for smart indenting. */ --- 1147,1158 ---- *************** *** 1175,1183 **** may_do_si() { return curbuf->b_p_si - # ifdef FEAT_CINDENT && !curbuf->b_p_cin - # endif # ifdef FEAT_EVAL && *curbuf->b_p_inde == NUL # endif --- 1160,1166 ---- *************** *** 1263,1269 **** if (ai_col > curwin->w_cursor.col) ai_col = curwin->w_cursor.col; } - #endif /* * Insert an indent (for or CTRL-T) or delete an indent (for CTRL-D). --- 1246,1251 ---- *************** *** 1865,1871 **** u_clearline(); } ! #if (defined(FEAT_CINDENT) && defined(FEAT_EVAL)) || defined(PROTO) /* * Get indent level from 'indentexpr'. */ --- 1847,1853 ---- u_clearline(); } ! #if defined(FEAT_EVAL) || defined(PROTO) /* * Get indent level from 'indentexpr'. */ *************** *** 1933,1940 **** } #endif - #if defined(FEAT_LISP) || defined(PROTO) - static int lisp_match(char_u *p) { --- 1915,1920 ---- *************** *** 2150,2158 **** return amount; } - #endif // FEAT_LISP - #if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(PROTO) /* * Re-indent the current line, based on the current contents of it and the * surrounding lines. Fixing the cursor position seems really easy -- I'm very --- 2130,2136 ---- *************** *** 2181,2199 **** { if (p_paste) return; - # ifdef FEAT_LISP if (curbuf->b_p_lisp && curbuf->b_p_ai) fixthisline(get_lisp_indent); - # endif - # if defined(FEAT_LISP) && defined(FEAT_CINDENT) else - # endif - # ifdef FEAT_CINDENT if (cindent_on()) do_c_expr_indent(); - # endif } - #endif #if defined(FEAT_EVAL) || defined(PROTO) /* --- 2159,2170 ---- *************** *** 2224,2230 **** void f_lispindent(typval_T *argvars UNUSED, typval_T *rettv) { - # ifdef FEAT_LISP pos_T pos; linenr_T lnum; --- 2195,2200 ---- *************** *** 2242,2248 **** else if (in_vim9script()) semsg(_(e_invalid_line_number_nr), lnum); else - # endif rettv->vval.v_number = -1; } #endif --- 2212,2217 ---- *** ../vim-8.2.4992/src/insexpand.c 2022-05-09 20:09:19.286641426 +0100 --- src/insexpand.c 2022-05-21 19:32:21.329373830 +0100 *************** *** 263,271 **** /* * Functions to check the current CTRL-X mode. */ - #ifdef FEAT_CINDENT int ctrl_x_mode_none(void) { return ctrl_x_mode == 0; } - #endif int ctrl_x_mode_normal(void) { return ctrl_x_mode == CTRL_X_NORMAL; } int ctrl_x_mode_scroll(void) { return ctrl_x_mode == CTRL_X_SCROLL; } int ctrl_x_mode_whole_line(void) { return ctrl_x_mode == CTRL_X_WHOLE_LINE; } --- 263,269 ---- *************** *** 2151,2159 **** ins_compl_stop(int c, int prev_mode, int retval) { char_u *ptr; - #ifdef FEAT_CINDENT int want_cindent; - #endif // Get here when we have finished typing a sequence of ^N and // ^P or other completion characters in CTRL-X mode. Free up --- 2149,2155 ---- *************** *** 2173,2193 **** ins_compl_fixRedoBufForLeader(ptr); } - #ifdef FEAT_CINDENT want_cindent = (get_can_cindent() && cindent_on()); ! #endif // When completing whole lines: fix indent for 'cindent'. // Otherwise, break line if it's too long. if (compl_cont_mode == CTRL_X_WHOLE_LINE) { - #ifdef FEAT_CINDENT // re-indent the current line if (want_cindent) { do_c_expr_indent(); want_cindent = FALSE; // don't do it again } - #endif } else { --- 2169,2186 ---- ins_compl_fixRedoBufForLeader(ptr); } want_cindent = (get_can_cindent() && cindent_on()); ! // When completing whole lines: fix indent for 'cindent'. // Otherwise, break line if it's too long. if (compl_cont_mode == CTRL_X_WHOLE_LINE) { // re-indent the current line if (want_cindent) { do_c_expr_indent(); want_cindent = FALSE; // don't do it again } } else { *************** *** 2251,2261 **** // command line window. update_screen(0); #endif - #ifdef FEAT_CINDENT // Indent now if a key was typed that is in 'cinkeys'. if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0))) do_c_expr_indent(); - #endif // Trigger the CompleteDone event to give scripts a chance to act // upon the end of completion. ins_apply_autocmds(EVENT_COMPLETEDONE); --- 2244,2252 ---- *************** *** 4738,4748 **** // First time we hit ^N or ^P (in a row, I mean) did_ai = FALSE; - #ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; - #endif if (stop_arrow() == FAIL) return FAIL; --- 4729,4737 ---- *** ../vim-8.2.4992/src/main.c 2022-05-07 20:01:10.058731693 +0100 --- src/main.c 2022-05-21 19:36:29.893176875 +0100 *************** *** 2180,2189 **** break; case 'l': // "-l" lisp mode, 'lisp' and 'showmatch' on - #ifdef FEAT_LISP set_option_value_give_err((char_u *)"lisp", 1L, NULL, 0); p_sm = TRUE; - #endif break; case 'M': // "-M" no changes or writing of files --- 2180,2187 ---- *************** *** 3494,3502 **** main_msg(_("-m\t\t\tModifications (writing files) not allowed")); main_msg(_("-M\t\t\tModifications in text not allowed")); main_msg(_("-b\t\t\tBinary mode")); - #ifdef FEAT_LISP main_msg(_("-l\t\t\tLisp mode")); - #endif main_msg(_("-C\t\t\tCompatible with Vi: 'compatible'")); main_msg(_("-N\t\t\tNot fully Vi compatible: 'nocompatible'")); main_msg(_("-V[N][fname]\t\tBe verbose [level N] [log messages to fname]")); --- 3492,3498 ---- *** ../vim-8.2.4992/src/mouse.c 2022-05-20 13:45:55.841397177 +0100 --- src/mouse.c 2022-05-21 19:15:45.125904481 +0100 *************** *** 1083,1091 **** curwin = new_curwin; curbuf = curwin->w_buffer; } - # ifdef FEAT_CINDENT set_can_cindent(TRUE); - # endif } // redraw status lines (in case another window became active) --- 1083,1089 ---- *************** *** 1173,1181 **** if (!EQUAL_POS(curwin->w_cursor, tpos)) { start_arrow(&tpos); - # ifdef FEAT_CINDENT set_can_cindent(TRUE); - # endif } } --- 1171,1177 ---- *** ../vim-8.2.4992/src/ops.c 2022-05-15 13:07:58.366684986 +0100 --- src/ops.c 2022-05-21 19:32:33.637364348 +0100 *************** *** 159,168 **** else // Move the line right if it doesn't start with '#', 'smartindent' // isn't set or 'cindent' isn't set or '#' isn't in 'cino'. - #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) if (first_char != '#' || !preprocs_left()) ! #endif ! shift_line(oap->op_type == OP_LSHIFT, p_sr, amount, FALSE); ++curwin->w_cursor.lnum; } --- 159,166 ---- else // Move the line right if it doesn't start with '#', 'smartindent' // isn't set or 'cindent' isn't set or '#' isn't in 'cino'. if (first_char != '#' || !preprocs_left()) ! shift_line(oap->op_type == OP_LSHIFT, p_sr, amount, FALSE); ++curwin->w_cursor.lnum; } *************** *** 1717,1725 **** if (oap->motion_type == MLINE) { l = 0; - #ifdef FEAT_SMARTINDENT can_si = may_do_si(); // Like opening a new line, do smart indent - #endif } // First delete the text in the region. In an empty buffer only need to --- 1715,1721 ---- *************** *** 1750,1759 **** bd.textcol = curwin->w_cursor.col; } - #if defined(FEAT_LISP) || defined(FEAT_CINDENT) if (oap->motion_type == MLINE) fix_indent(); - #endif retval = edit(NUL, FALSE, (linenr_T)1); --- 1746,1753 ---- *************** *** 3292,3302 **** stuffReadbuff((char_u *)"!"); if (oap->op_type == OP_INDENT) { - #ifndef FEAT_CINDENT if (*get_equalprg() == NUL) stuffReadbuff((char_u *)"indent"); else - #endif stuffReadbuff(get_equalprg()); stuffReadbuff((char_u *)"\n"); } --- 3286,3294 ---- *************** *** 4057,4083 **** case OP_INDENT: case OP_COLON: - #if defined(FEAT_LISP) || defined(FEAT_CINDENT) // If 'equalprg' is empty, do the indenting internally. if (oap->op_type == OP_INDENT && *get_equalprg() == NUL) { - # ifdef FEAT_LISP if (curbuf->b_p_lisp) { op_reindent(oap, get_lisp_indent); break; } - # endif - # ifdef FEAT_CINDENT op_reindent(oap, ! # ifdef FEAT_EVAL *curbuf->b_p_inde != NUL ? get_expr_indent : ! # endif get_c_indent); break; - # endif } - #endif op_colon(oap); break; --- 4049,4069 ---- case OP_INDENT: case OP_COLON: // If 'equalprg' is empty, do the indenting internally. if (oap->op_type == OP_INDENT && *get_equalprg() == NUL) { if (curbuf->b_p_lisp) { op_reindent(oap, get_lisp_indent); break; } op_reindent(oap, ! #ifdef FEAT_EVAL *curbuf->b_p_inde != NUL ? get_expr_indent : ! #endif get_c_indent); break; } op_colon(oap); break; *** ../vim-8.2.4992/src/option.c 2022-05-20 10:10:29.948122642 +0100 --- src/option.c 2022-05-21 19:36:50.009160503 +0100 *************** *** 658,666 **** // The 'scroll' option must be computed for all windows. FOR_ALL_TAB_WINDOWS(tp, wp) win_comp_scroll(wp); - #ifdef FEAT_CINDENT parse_cino(curbuf); - #endif } /* --- 658,664 ---- *************** *** 2538,2546 **** # ifdef FEAT_BEVAL case PV_BEXPR: return &curbuf->b_p_bexpr_flags; # endif - # if defined(FEAT_CINDENT) case PV_INDE: return &curbuf->b_p_inde_flags; - # endif case PV_FEX: return &curbuf->b_p_fex_flags; # ifdef FEAT_FIND_ID case PV_INEX: return &curbuf->b_p_inex_flags; --- 2536,2542 ---- *************** *** 2991,3002 **** * When 'lisp' option changes include/exclude '-' in * keyword characters. */ - #ifdef FEAT_LISP else if (varp == (char_u *)&(curbuf->b_p_lisp)) { (void)buf_init_chartab(curbuf, FALSE); // ignore errors } - #endif // when 'title' changed, may need to change the title; same for 'icon' else if ((int *)varp == &p_title || (int *)varp == &p_icon) --- 2987,2996 ---- *************** *** 3490,3511 **** } #endif // FEAT_FOLDING - #if defined(FEAT_FOLDING) || defined(FEAT_CINDENT) // 'shiftwidth' or 'tabstop' else if (pp == &curbuf->b_p_sw || pp == &curbuf->b_p_ts) { ! # ifdef FEAT_FOLDING if (foldmethodIsIndent(curwin)) foldUpdateAll(curwin); ! # endif ! # ifdef FEAT_CINDENT // When 'shiftwidth' changes, or it's zero and 'tabstop' changes: // parse 'cinoptions'. if (pp == &curbuf->b_p_sw || curbuf->b_p_sw == 0) parse_cino(curbuf); - # endif } - #endif // 'maxcombine' else if (pp == &p_mco) --- 3484,3501 ---- } #endif // FEAT_FOLDING // 'shiftwidth' or 'tabstop' else if (pp == &curbuf->b_p_sw || pp == &curbuf->b_p_ts) { ! #ifdef FEAT_FOLDING if (foldmethodIsIndent(curwin)) foldUpdateAll(curwin); ! #endif // When 'shiftwidth' changes, or it's zero and 'tabstop' changes: // parse 'cinoptions'. if (pp == &curbuf->b_p_sw || curbuf->b_p_sw == 0) parse_cino(curbuf); } // 'maxcombine' else if (pp == &p_mco) *************** *** 5206,5216 **** case PV_UL: buf->b_p_ul = NO_LOCAL_UNDOLEVEL; break; - #ifdef FEAT_LISP case PV_LW: clear_string_option(&buf->b_p_lw); break; - #endif case PV_MENC: clear_string_option(&buf->b_p_menc); break; --- 5196,5204 ---- *************** *** 5280,5288 **** case PV_STL: return (char_u *)&(curwin->w_p_stl); #endif case PV_UL: return (char_u *)&(curbuf->b_p_ul); - #ifdef FEAT_LISP case PV_LW: return (char_u *)&(curbuf->b_p_lw); - #endif case PV_BKC: return (char_u *)&(curbuf->b_p_bkc); case PV_MENC: return (char_u *)&(curbuf->b_p_menc); case PV_LCS: return (char_u *)&(curwin->w_p_lcs); --- 5268,5274 ---- *************** *** 5379,5388 **** #endif case PV_UL: return curbuf->b_p_ul != NO_LOCAL_UNDOLEVEL ? (char_u *)&(curbuf->b_p_ul) : p->var; - #ifdef FEAT_LISP case PV_LW: return *curbuf->b_p_lw != NUL ? (char_u *)&(curbuf->b_p_lw) : p->var; - #endif case PV_MENC: return *curbuf->b_p_menc != NUL ? (char_u *)&(curbuf->b_p_menc) : p->var; #ifdef FEAT_ARABIC --- 5365,5372 ---- *************** *** 5460,5474 **** case PV_BT: return (char_u *)&(curbuf->b_p_bt); case PV_BL: return (char_u *)&(curbuf->b_p_bl); case PV_CI: return (char_u *)&(curbuf->b_p_ci); - #ifdef FEAT_CINDENT case PV_CIN: return (char_u *)&(curbuf->b_p_cin); case PV_CINK: return (char_u *)&(curbuf->b_p_cink); case PV_CINO: return (char_u *)&(curbuf->b_p_cino); case PV_CINSD: return (char_u *)&(curbuf->b_p_cinsd); - #endif - #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) case PV_CINW: return (char_u *)&(curbuf->b_p_cinw); - #endif case PV_COM: return (char_u *)&(curbuf->b_p_com); #ifdef FEAT_FOLDING case PV_CMS: return (char_u *)&(curbuf->b_p_cms); --- 5444,5454 ---- *************** *** 5501,5507 **** case PV_INEX: return (char_u *)&(curbuf->b_p_inex); # endif #endif ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) case PV_INDE: return (char_u *)&(curbuf->b_p_inde); case PV_INDK: return (char_u *)&(curbuf->b_p_indk); #endif --- 5481,5487 ---- case PV_INEX: return (char_u *)&(curbuf->b_p_inex); # endif #endif ! #if defined(FEAT_EVAL) case PV_INDE: return (char_u *)&(curbuf->b_p_inde); case PV_INDK: return (char_u *)&(curbuf->b_p_indk); #endif *************** *** 5511,5519 **** #ifdef FEAT_CRYPT case PV_KEY: return (char_u *)&(curbuf->b_p_key); #endif - #ifdef FEAT_LISP case PV_LISP: return (char_u *)&(curbuf->b_p_lisp); - #endif case PV_ML: return (char_u *)&(curbuf->b_p_ml); case PV_MPS: return (char_u *)&(curbuf->b_p_mps); case PV_MA: return (char_u *)&(curbuf->b_p_ma); --- 5491,5497 ---- *************** *** 5524,5532 **** case PV_QE: return (char_u *)&(curbuf->b_p_qe); #endif case PV_RO: return (char_u *)&(curbuf->b_p_ro); - #ifdef FEAT_SMARTINDENT case PV_SI: return (char_u *)&(curbuf->b_p_si); - #endif case PV_SN: return (char_u *)&(curbuf->b_p_sn); case PV_STS: return (char_u *)&(curbuf->b_p_sts); #ifdef FEAT_SEARCHPATH --- 5502,5508 ---- *************** *** 6023,6035 **** COPY_OPT_SCTX(buf, BV_NF); buf->b_p_mps = vim_strsave(p_mps); COPY_OPT_SCTX(buf, BV_MPS); - #ifdef FEAT_SMARTINDENT buf->b_p_si = p_si; COPY_OPT_SCTX(buf, BV_SI); - #endif buf->b_p_ci = p_ci; COPY_OPT_SCTX(buf, BV_CI); ! #ifdef FEAT_CINDENT buf->b_p_cin = p_cin; COPY_OPT_SCTX(buf, BV_CIN); buf->b_p_cink = vim_strsave(p_cink); --- 5999,6009 ---- COPY_OPT_SCTX(buf, BV_NF); buf->b_p_mps = vim_strsave(p_mps); COPY_OPT_SCTX(buf, BV_MPS); buf->b_p_si = p_si; COPY_OPT_SCTX(buf, BV_SI); buf->b_p_ci = p_ci; COPY_OPT_SCTX(buf, BV_CI); ! buf->b_p_cin = p_cin; COPY_OPT_SCTX(buf, BV_CIN); buf->b_p_cink = vim_strsave(p_cink); *************** *** 6038,6056 **** COPY_OPT_SCTX(buf, BV_CINO); buf->b_p_cinsd = vim_strsave(p_cinsd); COPY_OPT_SCTX(buf, BV_CINSD); ! #endif // Don't copy 'filetype', it must be detected buf->b_p_ft = empty_option; buf->b_p_pi = p_pi; COPY_OPT_SCTX(buf, BV_PI); - #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) buf->b_p_cinw = vim_strsave(p_cinw); COPY_OPT_SCTX(buf, BV_CINW); - #endif - #ifdef FEAT_LISP buf->b_p_lisp = p_lisp; COPY_OPT_SCTX(buf, BV_LISP); - #endif #ifdef FEAT_SYN_HL // Don't copy 'syntax', it must be set buf->b_p_syn = empty_option; --- 6012,6026 ---- COPY_OPT_SCTX(buf, BV_CINO); buf->b_p_cinsd = vim_strsave(p_cinsd); COPY_OPT_SCTX(buf, BV_CINSD); ! // Don't copy 'filetype', it must be detected buf->b_p_ft = empty_option; buf->b_p_pi = p_pi; COPY_OPT_SCTX(buf, BV_PI); buf->b_p_cinw = vim_strsave(p_cinw); COPY_OPT_SCTX(buf, BV_CINW); buf->b_p_lisp = p_lisp; COPY_OPT_SCTX(buf, BV_LISP); #ifdef FEAT_SYN_HL // Don't copy 'syntax', it must be set buf->b_p_syn = empty_option; *************** *** 6069,6075 **** buf->b_s.b_p_spo = vim_strsave(p_spo); COPY_OPT_SCTX(buf, BV_SPO); #endif ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) buf->b_p_inde = vim_strsave(p_inde); COPY_OPT_SCTX(buf, BV_INDE); buf->b_p_indk = vim_strsave(p_indk); --- 6039,6045 ---- buf->b_s.b_p_spo = vim_strsave(p_spo); COPY_OPT_SCTX(buf, BV_SPO); #endif ! #if defined(FEAT_EVAL) buf->b_p_inde = vim_strsave(p_inde); COPY_OPT_SCTX(buf, BV_INDE); buf->b_p_indk = vim_strsave(p_indk); *************** *** 6148,6156 **** buf->b_p_udf = p_udf; COPY_OPT_SCTX(buf, BV_UDF); #endif - #ifdef FEAT_LISP buf->b_p_lw = empty_option; - #endif buf->b_p_menc = empty_option; /* --- 6118,6124 ---- *** ../vim-8.2.4992/src/optionstr.c 2022-05-12 17:44:25.819076137 +0100 --- src/optionstr.c 2022-05-21 19:36:54.813156586 +0100 *************** *** 215,221 **** check_string_option(&buf->b_p_inex); # endif #endif ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) check_string_option(&buf->b_p_inde); check_string_option(&buf->b_p_indk); #endif --- 215,221 ---- check_string_option(&buf->b_p_inex); # endif #endif ! #if defined(FEAT_EVAL) check_string_option(&buf->b_p_inde); check_string_option(&buf->b_p_indk); #endif *************** *** 258,273 **** #ifdef FEAT_SEARCHPATH check_string_option(&buf->b_p_sua); #endif - #ifdef FEAT_CINDENT check_string_option(&buf->b_p_cink); check_string_option(&buf->b_p_cino); check_string_option(&buf->b_p_cinsd); parse_cino(buf); - #endif check_string_option(&buf->b_p_ft); - #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) check_string_option(&buf->b_p_cinw); - #endif check_string_option(&buf->b_p_cpt); #ifdef FEAT_COMPL_FUNC check_string_option(&buf->b_p_cfu); --- 258,269 ---- *************** *** 291,299 **** check_string_option(&buf->b_p_tc); check_string_option(&buf->b_p_dict); check_string_option(&buf->b_p_tsr); - #ifdef FEAT_LISP check_string_option(&buf->b_p_lw); - #endif check_string_option(&buf->b_p_bkc); check_string_option(&buf->b_p_menc); #ifdef FEAT_VARTABS --- 287,293 ---- *************** *** 2116,2129 **** } #endif - #ifdef FEAT_CINDENT // 'cinoptions' else if (gvarp == &p_cino) { // TODO: recognize errors parse_cino(curbuf); } - #endif #if defined(FEAT_RENDER_OPTIONS) // 'renderoptions' --- 2110,2121 ---- *************** *** 2315,2323 **** # ifdef FEAT_FIND_ID gvarp == &p_inex || # endif - # ifdef FEAT_CINDENT gvarp == &p_inde || - # endif # ifdef FEAT_DIFF varp == &p_pex || # endif --- 2307,2313 ---- *************** *** 2351,2360 **** if (gvarp == &p_inex) // 'includeexpr' p_opt = &curbuf->b_p_inex; # endif - # ifdef FEAT_CINDENT if (gvarp == &p_inde) // 'indentexpr' p_opt = &curbuf->b_p_inde; - # endif # ifdef FEAT_DIFF if (varp == &p_pex) // 'patchexpr' p_opt = &p_pex; --- 2341,2348 ---- *** ../vim-8.2.4992/src/register.c 2022-04-09 11:37:08.196325535 +0100 --- src/register.c 2022-05-21 19:21:48.021790713 +0100 *************** *** 2154,2164 **** ptr = ml_get(lnum); if (cnt == count && i == y_size - 1) lendiff = (int)STRLEN(ptr); - #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) if (*ptr == '#' && preprocs_left()) indent = 0; // Leave # lines at start else - #endif if (*ptr == NUL) indent = 0; // Ignore empty lines else if (first_indent) --- 2154,2162 ---- *** ../vim-8.2.4992/src/search.c 2022-05-11 14:15:32.343235976 +0100 --- src/search.c 2022-05-21 19:38:21.225085641 +0100 *************** *** 2116,2125 **** int match_escaped = 0; // search for escaped match int dir; // Direction to search int comment_col = MAXCOL; // start of / / comment - #ifdef FEAT_LISP int lispcomm = FALSE; // inside of Lisp-style comment int lisp = curbuf->b_p_lisp; // engage Lisp-specific hacks ;) - #endif pos = curwin->w_cursor; pos.coladd = 0; --- 2116,2123 ---- *************** *** 2348,2363 **** CLEAR_POS(&match_pos); // backward search: Check if this line contains a single-line comment ! if ((backwards && comment_dir) ! #ifdef FEAT_LISP ! || lisp ! #endif ! ) comment_col = check_linecomment(linep); - #ifdef FEAT_LISP if (lisp && comment_col != MAXCOL && pos.col > (colnr_T)comment_col) lispcomm = TRUE; // find match inside this comment ! #endif while (!got_int) { /* --- 2346,2356 ---- CLEAR_POS(&match_pos); // backward search: Check if this line contains a single-line comment ! if ((backwards && comment_dir) || lisp) comment_col = check_linecomment(linep); if (lisp && comment_col != MAXCOL && pos.col > (colnr_T)comment_col) lispcomm = TRUE; // find match inside this comment ! while (!got_int) { /* *************** *** 2366,2376 **** */ if (backwards) { - #ifdef FEAT_LISP // char to match is inside of comment, don't search outside if (lispcomm && pos.col < (colnr_T)comment_col) break; - #endif if (pos.col == 0) // at start of line, go to prev. one { if (pos.lnum == 1) // start of file --- 2359,2367 ---- *************** *** 2386,2402 **** line_breakcheck(); // Check if this line contains a single-line comment ! if (comment_dir ! #ifdef FEAT_LISP ! || lisp ! #endif ! ) comment_col = check_linecomment(linep); - #ifdef FEAT_LISP // skip comment if (lisp && comment_col != MAXCOL) pos.col = comment_col; - #endif } else { --- 2377,2387 ---- line_breakcheck(); // Check if this line contains a single-line comment ! if (comment_dir || lisp) comment_col = check_linecomment(linep); // skip comment if (lisp && comment_col != MAXCOL) pos.col = comment_col; } else { *************** *** 2409,2428 **** { if (linep[pos.col] == NUL // at end of line, go to next one ! #ifdef FEAT_LISP ! // don't search for match in comment || (lisp && comment_col != MAXCOL ! && pos.col == (colnr_T)comment_col) ! #endif ! ) { if (pos.lnum == curbuf->b_ml.ml_line_count // end of file - #ifdef FEAT_LISP // line is exhausted and comment with it, // don't search for match in code ! || lispcomm ! #endif ! ) break; ++pos.lnum; --- 2394,2407 ---- { if (linep[pos.col] == NUL // at end of line, go to next one ! // For lisp don't search for match in comment || (lisp && comment_col != MAXCOL ! && pos.col == (colnr_T)comment_col)) { if (pos.lnum == curbuf->b_ml.ml_line_count // end of file // line is exhausted and comment with it, // don't search for match in code ! || lispcomm) break; ++pos.lnum; *************** *** 2433,2442 **** pos.col = 0; do_quotes = -1; line_breakcheck(); - #ifdef FEAT_LISP if (lisp) // find comment pos in new line comment_col = check_linecomment(linep); - #endif } else { --- 2412,2419 ---- *************** *** 2679,2685 **** // FALLTHROUGH default: - #ifdef FEAT_LISP /* * For Lisp skip over backslashed (), {} and []. * (actually, we skip #\( et al) --- 2656,2661 ---- *************** *** 2690,2696 **** && check_prevcol(linep, pos.col, '\\', NULL) && check_prevcol(linep, pos.col - 1, '#', NULL)) break; - #endif // Check for match outside of quotes, and inside of // quotes when the start is also inside of quotes. --- 2666,2671 ---- *************** *** 2739,2745 **** char_u *p; p = line; - #ifdef FEAT_LISP // skip Lispish one-line comments if (curbuf->b_p_lisp) { --- 2714,2719 ---- *************** *** 2773,2789 **** p = NULL; } else ! #endif ! while ((p = vim_strchr(p, '/')) != NULL) ! { ! // Accept a double /, unless it's preceded with * and followed by *, ! // because * / / * is an end and start of a C comment. ! // Only accept the position if it is not inside a string. ! if (p[1] == '/' && (p == line || p[-1] != '*' || p[2] != '*') && !is_pos_in_string(line, (colnr_T)(p - line))) ! break; ! ++p; ! } if (p == NULL) return MAXCOL; --- 2747,2762 ---- p = NULL; } else ! while ((p = vim_strchr(p, '/')) != NULL) ! { ! // Accept a double /, unless it's preceded with * and followed by ! // *, because * / / * is an end and start of a C comment. Only ! // accept the position if it is not inside a string. ! if (p[1] == '/' && (p == line || p[-1] != '*' || p[2] != '*') && !is_pos_in_string(line, (colnr_T)(p - line))) ! break; ! ++p; ! } if (p == NULL) return MAXCOL; *************** *** 3117,3124 **** return OK; } - #if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(FEAT_TEXTOBJ) \ - || defined(PROTO) /* * return TRUE if line 'lnum' is empty or has white chars only. */ --- 3090,3095 ---- *************** *** 3130,3136 **** p = skipwhite(ml_get(lnum)); return (*p == NUL); } - #endif /* * Add the search count "[3/19]" to "msgbuf". --- 3101,3106 ---- *** ../vim-8.2.4992/src/textformat.c 2022-05-09 20:09:19.294641425 +0100 --- src/textformat.c 2022-05-21 19:38:32.213076560 +0100 *************** *** 108,114 **** char_u *line = ml_get_curline(); leader_len = get_leader_len(line, NULL, FALSE, TRUE); - #ifdef FEAT_CINDENT if (leader_len == 0 && curbuf->b_p_cin) { int comment_start; --- 108,113 ---- *************** *** 123,129 **** leader_len += comment_start; } } - #endif } else leader_len = 0; --- 122,127 ---- *************** *** 444,459 **** } haveto_redraw = TRUE; - #ifdef FEAT_CINDENT set_can_cindent(TRUE); - #endif // moved the cursor, don't autoindent or cindent now did_ai = FALSE; - #ifdef FEAT_SMARTINDENT did_si = FALSE; can_si = FALSE; can_si_back = FALSE; - #endif line_breakcheck(); } --- 442,453 ---- *************** *** 1119,1132 **** // indent. if (curwin->w_cursor.lnum == first_line) indent = get_indent(); ! else ! # ifdef FEAT_LISP ! if (curbuf->b_p_lisp) indent = get_lisp_indent(); else - # endif { - #ifdef FEAT_CINDENT if (cindent_on()) { indent = --- 1113,1122 ---- // indent. if (curwin->w_cursor.lnum == first_line) indent = get_indent(); ! else if (curbuf->b_p_lisp) indent = get_lisp_indent(); else { if (cindent_on()) { indent = *************** *** 1136,1142 **** get_c_indent(); } else - #endif indent = get_indent(); } (void)set_indent(indent, SIN_CHANGED); --- 1126,1131 ---- *** ../vim-8.2.4992/src/version.c 2022-05-21 18:56:54.767003704 +0100 --- src/version.c 2022-05-21 19:38:39.601070445 +0100 *************** *** 152,162 **** #else "-channel", #endif - #ifdef FEAT_CINDENT "+cindent", - #else - "-cindent", - #endif #ifdef FEAT_CLIENTSERVER "+clientserver", #else --- 152,158 ---- *************** *** 334,344 **** #else "-linebreak", #endif - #ifdef FEAT_LISP "+lispindent", - #else - "-lispindent", - #endif "+listcmds", "+localmap", #ifdef FEAT_LUA --- 330,336 ---- *************** *** 546,556 **** #else "-signs", #endif - #ifdef FEAT_SMARTINDENT "+smartindent", - #else - "-smartindent", - #endif #ifdef FEAT_SODIUM # ifdef DYNAMIC_SODIUM "+sodium/dyn", --- 538,544 ---- *** ../vim-8.2.4992/src/option.h 2022-05-09 20:09:19.290641428 +0100 --- src/option.h 2022-05-21 19:39:20.849036201 +0100 *************** *** 398,411 **** EXTERN int p_bin; // 'binary' EXTERN int p_bomb; // 'bomb' EXTERN int p_bl; // 'buflisted' - #ifdef FEAT_CINDENT EXTERN int p_cin; // 'cindent' EXTERN char_u *p_cink; // 'cinkeys' EXTERN char_u *p_cinsd; // 'cinscopedecls' - #endif - #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) EXTERN char_u *p_cinw; // 'cinwords' - #endif #ifdef FEAT_COMPL_FUNC EXTERN char_u *p_cfu; // 'completefunc' EXTERN char_u *p_ofu; // 'omnifunc' --- 398,407 ---- *************** *** 491,499 **** EXTERN char_u *p_ccv; // 'charconvert' #endif EXTERN int p_cdh; // 'cdhome' - #ifdef FEAT_CINDENT EXTERN char_u *p_cino; // 'cinoptions' - #endif #ifdef FEAT_CMDWIN EXTERN char_u *p_cedit; // 'cedit' EXTERN long p_cwh; // 'cmdwinheight' --- 487,493 ---- *************** *** 688,694 **** EXTERN char_u *p_inex; // 'includeexpr' #endif EXTERN int p_is; // 'incsearch' ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) EXTERN char_u *p_inde; // 'indentexpr' EXTERN char_u *p_indk; // 'indentkeys' #endif --- 682,688 ---- EXTERN char_u *p_inex; // 'includeexpr' #endif EXTERN int p_is; // 'incsearch' ! #if defined(FEAT_EVAL) EXTERN char_u *p_inde; // 'indentexpr' EXTERN char_u *p_indk; // 'indentkeys' #endif *************** *** 717,726 **** #ifdef FEAT_GUI EXTERN long p_linespace; // 'linespace' #endif - #ifdef FEAT_LISP EXTERN int p_lisp; // 'lisp' EXTERN char_u *p_lispwords; // 'lispwords' - #endif EXTERN long p_ls; // 'laststatus' EXTERN long p_stal; // 'showtabline' EXTERN char_u *p_lcs; // 'listchars' --- 711,718 ---- *************** *** 914,922 **** EXTERN long p_ss; // 'sidescroll' EXTERN long p_siso; // 'sidescrolloff' EXTERN int p_scs; // 'smartcase' - #ifdef FEAT_SMARTINDENT EXTERN int p_si; // 'smartindent' - #endif EXTERN int p_sta; // 'smarttab' EXTERN long p_sts; // 'softtabstop' EXTERN int p_sb; // 'splitbelow' --- 906,912 ---- *************** *** 1125,1139 **** , BV_BL , BV_BOMB , BV_CI - #ifdef FEAT_CINDENT , BV_CIN , BV_CINK , BV_CINO , BV_CINSD - #endif - #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) , BV_CINW - #endif , BV_CM #ifdef FEAT_FOLDING , BV_CMS --- 1115,1125 ---- *************** *** 1168,1174 **** , BV_FT , BV_IMI , BV_IMS ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) , BV_INDE , BV_INDK #endif --- 1154,1160 ---- , BV_FT , BV_IMI , BV_IMS ! #if defined(FEAT_EVAL) , BV_INDE , BV_INDK #endif *************** *** 1184,1193 **** , BV_KMAP #endif , BV_KP - #ifdef FEAT_LISP , BV_LISP , BV_LW - #endif , BV_MENC , BV_MA , BV_ML --- 1170,1177 ---- *************** *** 1203,1211 **** , BV_QE #endif , BV_RO - #ifdef FEAT_SMARTINDENT , BV_SI - #endif , BV_SN #ifdef FEAT_SYN_HL , BV_SMC --- 1187,1193 ---- *** ../vim-8.2.4992/src/optiondefs.h 2022-04-09 21:02:58.506251763 +0100 --- src/optiondefs.h 2022-05-21 19:40:39.708970288 +0100 *************** *** 40,54 **** #define PV_BL OPT_BUF(BV_BL) #define PV_BOMB OPT_BUF(BV_BOMB) #define PV_CI OPT_BUF(BV_CI) ! #ifdef FEAT_CINDENT ! # define PV_CIN OPT_BUF(BV_CIN) ! # define PV_CINK OPT_BUF(BV_CINK) ! # define PV_CINO OPT_BUF(BV_CINO) ! # define PV_CINSD OPT_BUF(BV_CINSD) ! #endif ! #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) ! # define PV_CINW OPT_BUF(BV_CINW) ! #endif #define PV_CM OPT_BOTH(OPT_BUF(BV_CM)) #ifdef FEAT_FOLDING # define PV_CMS OPT_BUF(BV_CMS) --- 40,50 ---- #define PV_BL OPT_BUF(BV_BL) #define PV_BOMB OPT_BUF(BV_BOMB) #define PV_CI OPT_BUF(BV_CI) ! #define PV_CIN OPT_BUF(BV_CIN) ! #define PV_CINK OPT_BUF(BV_CINK) ! #define PV_CINO OPT_BUF(BV_CINO) ! #define PV_CINSD OPT_BUF(BV_CINSD) ! #define PV_CINW OPT_BUF(BV_CINW) #define PV_CM OPT_BOTH(OPT_BUF(BV_CM)) #ifdef FEAT_FOLDING # define PV_CMS OPT_BUF(BV_CMS) *************** *** 83,89 **** #define PV_FT OPT_BUF(BV_FT) #define PV_IMI OPT_BUF(BV_IMI) #define PV_IMS OPT_BUF(BV_IMS) ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) # define PV_INDE OPT_BUF(BV_INDE) # define PV_INDK OPT_BUF(BV_INDK) #endif --- 79,85 ---- #define PV_FT OPT_BUF(BV_FT) #define PV_IMI OPT_BUF(BV_IMI) #define PV_IMS OPT_BUF(BV_IMS) ! #if defined(FEAT_EVAL) # define PV_INDE OPT_BUF(BV_INDE) # define PV_INDK OPT_BUF(BV_INDK) #endif *************** *** 99,108 **** # define PV_KMAP OPT_BUF(BV_KMAP) #endif #define PV_KP OPT_BOTH(OPT_BUF(BV_KP)) ! #ifdef FEAT_LISP ! # define PV_LISP OPT_BUF(BV_LISP) ! # define PV_LW OPT_BOTH(OPT_BUF(BV_LW)) ! #endif #define PV_MENC OPT_BOTH(OPT_BUF(BV_MENC)) #define PV_MA OPT_BUF(BV_MA) #define PV_ML OPT_BUF(BV_ML) --- 95,102 ---- # define PV_KMAP OPT_BUF(BV_KMAP) #endif #define PV_KP OPT_BOTH(OPT_BUF(BV_KP)) ! #define PV_LISP OPT_BUF(BV_LISP) ! #define PV_LW OPT_BOTH(OPT_BUF(BV_LW)) #define PV_MENC OPT_BOTH(OPT_BUF(BV_MENC)) #define PV_MA OPT_BUF(BV_MA) #define PV_ML OPT_BUF(BV_ML) *************** *** 118,126 **** # define PV_QE OPT_BUF(BV_QE) #endif #define PV_RO OPT_BUF(BV_RO) ! #ifdef FEAT_SMARTINDENT ! # define PV_SI OPT_BUF(BV_SI) ! #endif #define PV_SN OPT_BUF(BV_SN) #ifdef FEAT_SYN_HL # define PV_SMC OPT_BUF(BV_SMC) --- 112,118 ---- # define PV_QE OPT_BUF(BV_QE) #endif #define PV_RO OPT_BUF(BV_RO) ! #define PV_SI OPT_BUF(BV_SI) #define PV_SN OPT_BUF(BV_SN) #ifdef FEAT_SYN_HL # define PV_SMC OPT_BUF(BV_SMC) *************** *** 582,627 **** #endif SCTX_INIT}, {"cindent", "cin", P_BOOL|P_VI_DEF|P_VIM, - #ifdef FEAT_CINDENT (char_u *)&p_cin, PV_CIN, - #else - (char_u *)NULL, PV_NONE, - #endif {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"cinkeys", "cink", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, - #ifdef FEAT_CINDENT (char_u *)&p_cink, PV_CINK, ! {INDENTKEYS_DEFAULT, (char_u *)0L} ! #else ! (char_u *)NULL, PV_NONE, ! {(char_u *)0L, (char_u *)0L} ! #endif ! SCTX_INIT}, {"cinoptions", "cino", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, - #ifdef FEAT_CINDENT (char_u *)&p_cino, PV_CINO, - #else - (char_u *)NULL, PV_NONE, - #endif {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"cinscopedecls", "cinsd", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, - #ifdef FEAT_CINDENT (char_u *)&p_cinsd, PV_CINSD, {(char_u *)"public,protected,private", (char_u *)0L} - #else - (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} - #endif SCTX_INIT}, {"cinwords", "cinw", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, - #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) (char_u *)&p_cinw, PV_CINW, {(char_u *)"if,else,while,do,for,switch", (char_u *)0L} - #else - (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} - #endif SCTX_INIT}, {"clipboard", "cb", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_CLIPBOARD --- 574,595 ---- #endif SCTX_INIT}, {"cindent", "cin", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_cin, PV_CIN, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"cinkeys", "cink", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_cink, PV_CINK, ! {INDENTKEYS_DEFAULT, (char_u *)0L} SCTX_INIT}, {"cinoptions", "cino", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_cino, PV_CINO, {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"cinscopedecls", "cinsd", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_cinsd, PV_CINSD, {(char_u *)"public,protected,private", (char_u *)0L} SCTX_INIT}, {"cinwords", "cinw", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_cinw, PV_CINW, {(char_u *)"if,else,while,do,for,switch", (char_u *)0L} SCTX_INIT}, {"clipboard", "cb", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_CLIPBOARD *************** *** 1406,1412 **** (char_u *)&p_is, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"indentexpr", "inde", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM|P_MLE, ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) (char_u *)&p_inde, PV_INDE, {(char_u *)"", (char_u *)0L} #else --- 1374,1380 ---- (char_u *)&p_is, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"indentexpr", "inde", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM|P_MLE, ! #if defined(FEAT_EVAL) (char_u *)&p_inde, PV_INDE, {(char_u *)"", (char_u *)0L} #else *************** *** 1415,1421 **** #endif SCTX_INIT}, {"indentkeys", "indk", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) (char_u *)&p_indk, PV_INDK, {INDENTKEYS_DEFAULT, (char_u *)0L} #else --- 1383,1389 ---- #endif SCTX_INIT}, {"indentkeys", "indk", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_NODUP, ! #if defined(FEAT_EVAL) (char_u *)&p_indk, PV_INDK, {INDENTKEYS_DEFAULT, (char_u *)0L} #else *************** *** 1576,1596 **** #endif SCTX_INIT}, {"lisp", NULL, P_BOOL|P_VI_DEF, - #ifdef FEAT_LISP (char_u *)&p_lisp, PV_LISP, - #else - (char_u *)NULL, PV_NONE, - #endif {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"lispwords", "lw", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, - #ifdef FEAT_LISP (char_u *)&p_lispwords, PV_LW, ! {(char_u *)LISPWORD_VALUE, (char_u *)0L} ! #else ! (char_u *)NULL, PV_NONE, ! {(char_u *)"", (char_u *)0L} ! #endif ! SCTX_INIT}, {"list", NULL, P_BOOL|P_VI_DEF|P_RWIN, (char_u *)VAR_WIN, PV_LIST, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, --- 1544,1554 ---- #endif SCTX_INIT}, {"lisp", NULL, P_BOOL|P_VI_DEF, (char_u *)&p_lisp, PV_LISP, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"lispwords", "lw", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, (char_u *)&p_lispwords, PV_LW, ! {(char_u *)LISPWORD_VALUE, (char_u *)0L} SCTX_INIT}, {"list", NULL, P_BOOL|P_VI_DEF|P_RWIN, (char_u *)VAR_WIN, PV_LIST, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, *************** *** 2342,2352 **** (char_u *)&p_scs, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"smartindent", "si", P_BOOL|P_VI_DEF|P_VIM, - #ifdef FEAT_SMARTINDENT (char_u *)&p_si, PV_SI, - #else - (char_u *)NULL, PV_NONE, - #endif {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"smarttab", "sta", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_sta, PV_NONE, --- 2300,2306 ---- *** ../vim-8.2.4992/src/structs.h 2022-05-09 20:09:19.290641428 +0100 --- src/structs.h 2022-05-21 19:40:47.208963993 +0100 *************** *** 2879,2893 **** int b_has_qf_entry; #endif int b_p_bl; // 'buflisted' - #ifdef FEAT_CINDENT int b_p_cin; // 'cindent' char_u *b_p_cino; // 'cinoptions' char_u *b_p_cink; // 'cinkeys' char_u *b_p_cinsd; // 'cinscopedecls' - #endif - #if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT) char_u *b_p_cinw; // 'cinwords' - #endif char_u *b_p_com; // 'comments' #ifdef FEAT_FOLDING char_u *b_p_cms; // 'commentstring' --- 2879,2889 ---- *************** *** 2926,2932 **** long_u b_p_inex_flags; // flags for 'includeexpr' # endif #endif ! #if defined(FEAT_CINDENT) && defined(FEAT_EVAL) char_u *b_p_inde; // 'indentexpr' long_u b_p_inde_flags; // flags for 'indentexpr' char_u *b_p_indk; // 'indentkeys' --- 2922,2928 ---- long_u b_p_inex_flags; // flags for 'includeexpr' # endif #endif ! #if defined(FEAT_EVAL) char_u *b_p_inde; // 'indentexpr' long_u b_p_inde_flags; // flags for 'indentexpr' char_u *b_p_indk; // 'indentkeys' *************** *** 2940,2948 **** char_u *b_p_key; // 'key' #endif char_u *b_p_kp; // 'keywordprg' - #ifdef FEAT_LISP int b_p_lisp; // 'lisp' - #endif char_u *b_p_menc; // 'makeencoding' char_u *b_p_mps; // 'matchpairs' int b_p_ml; // 'modeline' --- 2936,2942 ---- *************** *** 2956,2964 **** int b_p_ro; // 'readonly' long b_p_sw; // 'shiftwidth' int b_p_sn; // 'shortname' - #ifdef FEAT_SMARTINDENT int b_p_si; // 'smartindent' - #endif long b_p_sts; // 'softtabstop' long b_p_sts_nopaste; // b_p_sts saved for paste mode #ifdef FEAT_SEARCHPATH --- 2950,2956 ---- *************** *** 3012,3020 **** #ifdef FEAT_PERSISTENT_UNDO int b_p_udf; // 'undofile' #endif - #ifdef FEAT_LISP char_u *b_p_lw; // 'lispwords' local value - #endif #ifdef FEAT_TERMINAL long b_p_twsl; // 'termwinscroll' #endif --- 3004,3010 ---- *************** *** 3023,3029 **** * end of buffer options */ - #ifdef FEAT_CINDENT // values set from b_p_cino int b_ind_level; int b_ind_open_imag; --- 3013,3018 ---- *************** *** 3062,3068 **** int b_ind_if_for_while; int b_ind_cpp_extern_c; int b_ind_pragma; - #endif linenr_T b_no_eol_lnum; // non-zero lnum when last line of next binary // write should not have an end-of-line --- 3051,3056 ---- *** ../vim-8.2.4992/src/globals.h 2022-05-07 20:01:10.058731693 +0100 --- src/globals.h 2022-05-21 19:34:16.537283896 +0100 *************** *** 937,943 **** */ EXTERN int did_syncbind INIT(= FALSE); - #ifdef FEAT_SMARTINDENT /* * This flag is set when a smart indent has been performed. When the next typed * character is a '{' the inserted tab will be deleted again. --- 937,942 ---- *************** *** 955,961 **** * one indent will be removed. */ EXTERN int can_si_back INIT(= FALSE); - #endif EXTERN int old_indent INIT(= 0); // for ^^D command in insert mode --- 954,959 ---- *** ../vim-8.2.4992/src/testdir/test_edit.vim 2022-05-08 22:49:39.398730465 +0100 --- src/testdir/test_edit.vim 2022-05-21 19:45:54.844071340 +0100 *************** *** 391,405 **** func Test_edit_13() " Test smartindenting ! if exists("+smartindent") ! new ! set smartindent autoindent ! call setline(1, ["\tabc"]) ! call feedkeys("A {\more\}\", 'tnix') ! call assert_equal(["\tabc {", "\t\tmore", "\t}"], getline(1, '$')) ! set smartindent& autoindent& ! bwipe! ! endif " Test autoindent removing indent of blank line. new --- 391,403 ---- func Test_edit_13() " Test smartindenting ! new ! set smartindent autoindent ! call setline(1, ["\tabc"]) ! call feedkeys("A {\more\}\", 'tnix') ! call assert_equal(["\tabc {", "\t\tmore", "\t}"], getline(1, '$')) ! set smartindent& autoindent& ! bwipe! " Test autoindent removing indent of blank line. new *** ../vim-8.2.4992/src/version.c 2022-05-21 18:56:54.767003704 +0100 --- src/version.c 2022-05-21 19:38:39.601070445 +0100 *************** *** 748,749 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 4993, /**/ -- hundred-and-one symptoms of being an internet addict: 248. You sign your letters with your e-mail address instead of your name. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///