From 161b6ac04f257ab17779e9ba6f5b3e3e15d2a0fd Mon Sep 17 00:00:00 2001 From: "K.Takata" Date: Mon, 14 Nov 2022 15:31:07 +0000 Subject: [PATCH] patch 9.0.0880: preprocessor indenting is off Problem: Preprocessor indenting is off. Solution: Adjust preprocessor indentation. (Ken Takata, closes #11546) --- src/cindent.c | 4 ++-- src/cmdexpand.c | 34 +++++++++++++++++----------------- src/gui.c | 4 ++-- src/if_perl.xs | 2 +- src/if_python3.c | 2 +- src/os_win32.c | 20 ++++++++++---------- src/version.c | 2 ++ 7 files changed, 35 insertions(+), 33 deletions(-) diff --git a/src/cindent.c b/src/cindent.c index 15b459cd6..105e08cc8 100644 --- 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 index 1f4791aa3..4f1262538 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -2756,7 +2756,7 @@ get_behave_arg(expand_T *xp UNUSED, int idx) 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_info_T *cclp, int key, expand_T *xp) 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 index dbd8d3fcc..88c0a1345 100644 --- 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 index 08e0e02f3..34315be71 100644 --- 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 index d06f66210..e0c546a3f 100644 --- 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 index c68a9732b..36051f485 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -1262,7 +1262,7 @@ decode_mouse_wheel(MOUSE_EVENT_RECORD *pmer) 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 *pmer) 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 index acd8922c1..f89595a84 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 880, /**/ 879, /**/ -- 2.40.0