# HG changeset patch # User Bram Moolenaar # Date 1668440704 -3600 # Node ID 551ce1a137da25b801db46d5d26ffe688fee3434 # Parent a681edbc43863cc8f2e3d4201721d8fed7957435 patch 9.0.0880: preprocessor indenting is off Commit: https://github.com/vim/vim/commit/161b6ac04f257ab17779e9ba6f5b3e3e15d2a0fd Author: K.Takata Date: Mon Nov 14 15:31:07 2022 +0000 patch 9.0.0880: preprocessor indenting is off Problem: Preprocessor indenting is off. Solution: Adjust preprocessor indentation. (Ken Takata, closes https://github.com/vim/vim/issues/11546) diff --git a/src/cindent.c b/src/cindent.c --- a/src/cindent.c +++ b/src/cindent.c @@ -4145,11 +4145,11 @@ in_cinkeys( void do_c_expr_indent(void) { -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL if (*curbuf->b_p_inde != NUL) fixthisline(get_expr_indent); else -# endif +#endif fixthisline(get_c_indent); } diff --git a/src/cmdexpand.c b/src/cmdexpand.c --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -2756,7 +2756,7 @@ get_behave_arg(expand_T *xp UNUSED, int return NULL; } -# ifdef FEAT_EVAL +#ifdef FEAT_EVAL /* * Function given to ExpandGeneric() to obtain the possible arguments of the * ":breakadd {expr, file, func, here}" command. @@ -3020,10 +3020,10 @@ ExpandFromContext( char *directories[] = {"syntax", "indent", "ftplugin", NULL}; return ExpandRTDir(pat, 0, numMatches, matches, directories); } -# if defined(FEAT_EVAL) +#if defined(FEAT_EVAL) if (xp->xp_context == EXPAND_USER_LIST) return ExpandUserList(xp, matches, numMatches); -# endif +#endif if (xp->xp_context == EXPAND_PACKADD) return ExpandPackAddDir(pat, numMatches, matches); @@ -3057,10 +3057,10 @@ ExpandFromContext( ret = ExpandSettings(xp, ®match, pat, numMatches, matches, fuzzy); else if (xp->xp_context == EXPAND_MAPPINGS) ret = ExpandMappings(pat, ®match, numMatches, matches); -# if defined(FEAT_EVAL) +#if defined(FEAT_EVAL) else if (xp->xp_context == EXPAND_USER_DEFINED) ret = ExpandUserDefined(pat, xp, ®match, matches, numMatches); -# endif +#endif else ret = ExpandOther(pat, xp, ®match, matches, numMatches); @@ -3168,7 +3168,7 @@ ExpandGeneric( else ((char_u **)ga.ga_data)[ga.ga_len] = str; -# ifdef FEAT_MENU +#ifdef FEAT_MENU if (func == get_menu_names) { // test for separator added by get_menu_names() @@ -3176,7 +3176,7 @@ ExpandGeneric( if (*str == '\001') *str = '.'; } -# endif +#endif ++ga.ga_len; } @@ -3350,11 +3350,11 @@ expand_shellcmd( hash_init(&found_ht); for (s = path; ; s = e) { -# if defined(MSWIN) +#if defined(MSWIN) e = vim_strchr(s, ';'); -# else +#else e = vim_strchr(s, ':'); -# endif +#endif if (e == NULL) e = s + STRLEN(s); @@ -3396,7 +3396,7 @@ expand_shellcmd( return OK; } -# if defined(FEAT_EVAL) +#if defined(FEAT_EVAL) /* * Call "user_expand_func()" to invoke a user defined Vim script function and * return the result (either a string, a List or NULL). @@ -3580,7 +3580,7 @@ ExpandUserList( *numMatches = ga.ga_len; return OK; } -# endif +#endif /* * Expand "file" for all comma-separated directories in "path". @@ -3613,14 +3613,14 @@ globpath( copy_option_part(&path, buf, MAXPATHL, ","); if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL) { -# if defined(MSWIN) +#if defined(MSWIN) // Using the platform's path separator (\) makes vim incorrectly // treat it as an escape character, use '/' instead. if (*buf != NUL && !after_pathsep(buf, buf + STRLEN(buf))) STRCAT(buf, "/"); -# else +#else add_pathsep(buf); -# endif +#endif STRCAT(buf, file); if (ExpandFromContext(&xpc, buf, &p, &num_p, WILD_SILENT|expand_options) != FAIL && num_p > 0) @@ -3828,10 +3828,10 @@ wildmenu_process_key_filenames(cmdline_i if (has_mbyte) j -= (*mb_head_off)(cclp->cmdbuff, cclp->cmdbuff + j); if (vim_ispathsep(cclp->cmdbuff[j]) -# ifdef BACKSLASH_IN_FILENAME +#ifdef BACKSLASH_IN_FILENAME && vim_strchr((char_u *)" *?[{`$%#", cclp->cmdbuff[j + 1]) == NULL -# endif +#endif ) { if (found) diff --git a/src/gui.c b/src/gui.c --- a/src/gui.c +++ b/src/gui.c @@ -230,10 +230,10 @@ gui_do_fork(void) int exit_status; pid_t pid = -1; -#if defined(FEAT_RELTIME) && defined(HAVE_TIMER_CREATE) +# if defined(FEAT_RELTIME) && defined(HAVE_TIMER_CREATE) // a timer is not carried forward delete_timer(); -#endif +# endif // Setup a pipe between the child and the parent, so that the parent // knows when the child has done the setsid() call and is allowed to diff --git a/src/if_perl.xs b/src/if_perl.xs --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -147,7 +147,7 @@ // Suppress Infinite warnings when compiling XS modules under macOS 12 Monterey. #if defined(__clang__) && defined(__clang_major__) && __clang_major__ > 11 -#pragma clang diagnostic ignored "-Wcompound-token-split-by-macro" +# pragma clang diagnostic ignored "-Wcompound-token-split-by-macro" #endif /* Compatibility hacks over */ diff --git a/src/if_python3.c b/src/if_python3.c --- a/src/if_python3.c +++ b/src/if_python3.c @@ -83,7 +83,7 @@ // Suppress Python 3.11 depreciations to see useful warnings #if defined(__clang__) && defined(__clang_major__) && __clang_major__ > 11 -#pragma clang diagnostic ignored "-Wdeprecated-declarations" +# pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif // Python 3 does not support CObjects, always use Capsules diff --git a/src/os_win32.c b/src/os_win32.c --- a/src/os_win32.c +++ b/src/os_win32.c @@ -1262,7 +1262,7 @@ decode_mouse_wheel(MOUSE_EVENT_RECORD *p g_xMouse = pmer->dwMousePosition.X; g_yMouse = pmer->dwMousePosition.Y; -#ifdef FEAT_PROP_POPUP +# ifdef FEAT_PROP_POPUP int lcol = g_xMouse; int lrow = g_yMouse; win_T *wp = mouse_find_win(&lrow, &lcol, FIND_POPUP); @@ -1294,7 +1294,7 @@ decode_mouse_wheel(MOUSE_EVENT_RECORD *p out_flush(); return; } -#endif +# endif mouse_col = g_xMouse; mouse_row = g_yMouse; @@ -6059,9 +6059,9 @@ insert_lines(unsigned cLines) fill.Char.AsciiChar = ' '; if (!(vtp_working -#ifdef FEAT_TERMGUICOLORS +# ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) -#endif +# endif )) fill.Attributes = g_attrCurrent; else @@ -6187,9 +6187,9 @@ gotoxy( return; if (!(vtp_working -#ifdef FEAT_TERMGUICOLORS +# ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) -#endif +# endif )) { // There are reports of double-width characters not displayed @@ -6435,9 +6435,9 @@ write_chars( } if (!(vtp_working -#ifdef FEAT_TERMGUICOLORS +# ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) -#endif +# endif )) { FillConsoleOutputAttribute(g_hConOut, g_attrCurrent, cells, @@ -6479,9 +6479,9 @@ write_chars( // Cursor under VTP is always in the correct position, no need to reset. if (!(vtp_working -#ifdef FEAT_TERMGUICOLORS +# ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) -#endif +# endif )) gotoxy(g_coord.X + 1, g_coord.Y + 1); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 880, +/**/ 879, /**/ 878,