To: vim_dev@googlegroups.com Subject: Patch 9.0.0880 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0880 Problem: Preprocessor indenting is off. Solution: Adjust preprocessor indentation. (Ken Takata, closes #11546) Files: src/cindent.c, src/cmdexpand.c, src/gui.c, src/if_perl.xs, src/if_python3.c, src/os_win32.c *** ../vim-9.0.0879/src/cindent.c 2022-07-27 15:48:42.343954974 +0100 --- src/cindent.c 2022-11-14 15:29:26.249541018 +0000 *************** *** 4145,4155 **** void do_c_expr_indent(void) { ! # ifdef FEAT_EVAL if (*curbuf->b_p_inde != NUL) fixthisline(get_expr_indent); else ! # endif fixthisline(get_c_indent); } --- 4145,4155 ---- void do_c_expr_indent(void) { ! #ifdef FEAT_EVAL if (*curbuf->b_p_inde != NUL) fixthisline(get_expr_indent); else ! #endif fixthisline(get_c_indent); } *** ../vim-9.0.0879/src/cmdexpand.c 2022-11-13 22:38:06.045883322 +0000 --- src/cmdexpand.c 2022-11-14 15:29:26.253541020 +0000 *************** *** 2756,2762 **** return NULL; } ! # ifdef FEAT_EVAL /* * Function given to ExpandGeneric() to obtain the possible arguments of the * ":breakadd {expr, file, func, here}" command. --- 2756,2762 ---- return NULL; } ! #ifdef FEAT_EVAL /* * Function given to ExpandGeneric() to obtain the possible arguments of the * ":breakadd {expr, file, func, here}" command. *************** *** 3020,3029 **** char *directories[] = {"syntax", "indent", "ftplugin", NULL}; return ExpandRTDir(pat, 0, numMatches, matches, directories); } ! # if defined(FEAT_EVAL) if (xp->xp_context == EXPAND_USER_LIST) return ExpandUserList(xp, matches, numMatches); ! # endif if (xp->xp_context == EXPAND_PACKADD) return ExpandPackAddDir(pat, numMatches, matches); --- 3020,3029 ---- char *directories[] = {"syntax", "indent", "ftplugin", NULL}; return ExpandRTDir(pat, 0, numMatches, matches, directories); } ! #if defined(FEAT_EVAL) if (xp->xp_context == EXPAND_USER_LIST) return ExpandUserList(xp, matches, numMatches); ! #endif if (xp->xp_context == EXPAND_PACKADD) return ExpandPackAddDir(pat, numMatches, matches); *************** *** 3057,3066 **** 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) else if (xp->xp_context == EXPAND_USER_DEFINED) ret = ExpandUserDefined(pat, xp, ®match, matches, numMatches); ! # endif else ret = ExpandOther(pat, xp, ®match, matches, numMatches); --- 3057,3066 ---- 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) else if (xp->xp_context == EXPAND_USER_DEFINED) ret = ExpandUserDefined(pat, xp, ®match, matches, numMatches); ! #endif else ret = ExpandOther(pat, xp, ®match, matches, numMatches); *************** *** 3168,3174 **** else ((char_u **)ga.ga_data)[ga.ga_len] = str; ! # ifdef FEAT_MENU if (func == get_menu_names) { // test for separator added by get_menu_names() --- 3168,3174 ---- else ((char_u **)ga.ga_data)[ga.ga_len] = str; ! #ifdef FEAT_MENU if (func == get_menu_names) { // test for separator added by get_menu_names() *************** *** 3176,3182 **** if (*str == '\001') *str = '.'; } ! # endif ++ga.ga_len; } --- 3176,3182 ---- if (*str == '\001') *str = '.'; } ! #endif ++ga.ga_len; } *************** *** 3350,3360 **** hash_init(&found_ht); for (s = path; ; s = e) { ! # if defined(MSWIN) e = vim_strchr(s, ';'); ! # else e = vim_strchr(s, ':'); ! # endif if (e == NULL) e = s + STRLEN(s); --- 3350,3360 ---- hash_init(&found_ht); for (s = path; ; s = e) { ! #if defined(MSWIN) e = vim_strchr(s, ';'); ! #else e = vim_strchr(s, ':'); ! #endif if (e == NULL) e = s + STRLEN(s); *************** *** 3396,3402 **** return OK; } ! # 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). --- 3396,3402 ---- return OK; } ! #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,3586 **** *numMatches = ga.ga_len; return OK; } ! # endif /* * Expand "file" for all comma-separated directories in "path". --- 3580,3586 ---- *numMatches = ga.ga_len; return OK; } ! #endif /* * Expand "file" for all comma-separated directories in "path". *************** *** 3613,3626 **** copy_option_part(&path, buf, MAXPATHL, ","); if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL) { ! # 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 add_pathsep(buf); ! # endif STRCAT(buf, file); if (ExpandFromContext(&xpc, buf, &p, &num_p, WILD_SILENT|expand_options) != FAIL && num_p > 0) --- 3613,3626 ---- copy_option_part(&path, buf, MAXPATHL, ","); if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL) { ! #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 add_pathsep(buf); ! #endif STRCAT(buf, file); if (ExpandFromContext(&xpc, buf, &p, &num_p, WILD_SILENT|expand_options) != FAIL && num_p > 0) *************** *** 3828,3837 **** if (has_mbyte) j -= (*mb_head_off)(cclp->cmdbuff, cclp->cmdbuff + j); if (vim_ispathsep(cclp->cmdbuff[j]) ! # ifdef BACKSLASH_IN_FILENAME && vim_strchr((char_u *)" *?[{`$%#", cclp->cmdbuff[j + 1]) == NULL ! # endif ) { if (found) --- 3828,3837 ---- if (has_mbyte) j -= (*mb_head_off)(cclp->cmdbuff, cclp->cmdbuff + j); if (vim_ispathsep(cclp->cmdbuff[j]) ! #ifdef BACKSLASH_IN_FILENAME && vim_strchr((char_u *)" *?[{`$%#", cclp->cmdbuff[j + 1]) == NULL ! #endif ) { if (found) *** ../vim-9.0.0879/src/gui.c 2022-11-07 12:16:46.397761740 +0000 --- src/gui.c 2022-11-14 15:29:26.253541020 +0000 *************** *** 230,239 **** int exit_status; pid_t pid = -1; ! #if defined(FEAT_RELTIME) && defined(HAVE_TIMER_CREATE) // a timer is not carried forward delete_timer(); ! #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 --- 230,239 ---- int exit_status; pid_t pid = -1; ! # if defined(FEAT_RELTIME) && defined(HAVE_TIMER_CREATE) // a timer is not carried forward delete_timer(); ! # 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 *** ../vim-9.0.0879/src/if_perl.xs 2022-11-04 22:32:14.024154421 +0000 --- src/if_perl.xs 2022-11-14 15:29:26.253541020 +0000 *************** *** 147,153 **** // 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" #endif /* Compatibility hacks over */ --- 147,153 ---- // 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" #endif /* Compatibility hacks over */ *** ../vim-9.0.0879/src/if_python3.c 2022-11-05 14:05:24.985275349 +0000 --- src/if_python3.c 2022-11-14 15:29:26.253541020 +0000 *************** *** 83,89 **** // Suppress Python 3.11 depreciations to see useful warnings #if defined(__clang__) && defined(__clang_major__) && __clang_major__ > 11 ! #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif // Python 3 does not support CObjects, always use Capsules --- 83,89 ---- // Suppress Python 3.11 depreciations to see useful warnings #if defined(__clang__) && defined(__clang_major__) && __clang_major__ > 11 ! # pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif // Python 3 does not support CObjects, always use Capsules *** ../vim-9.0.0879/src/os_win32.c 2022-11-12 18:45:59.818782978 +0000 --- src/os_win32.c 2022-11-14 15:29:26.253541020 +0000 *************** *** 1262,1268 **** g_xMouse = pmer->dwMousePosition.X; g_yMouse = pmer->dwMousePosition.Y; ! #ifdef FEAT_PROP_POPUP int lcol = g_xMouse; int lrow = g_yMouse; win_T *wp = mouse_find_win(&lrow, &lcol, FIND_POPUP); --- 1262,1268 ---- g_xMouse = pmer->dwMousePosition.X; g_yMouse = pmer->dwMousePosition.Y; ! # ifdef FEAT_PROP_POPUP int lcol = g_xMouse; int lrow = g_yMouse; win_T *wp = mouse_find_win(&lrow, &lcol, FIND_POPUP); *************** *** 1294,1300 **** out_flush(); return; } ! #endif mouse_col = g_xMouse; mouse_row = g_yMouse; --- 1294,1300 ---- out_flush(); return; } ! # endif mouse_col = g_xMouse; mouse_row = g_yMouse; *************** *** 6059,6067 **** fill.Char.AsciiChar = ' '; if (!(vtp_working ! #ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) ! #endif )) fill.Attributes = g_attrCurrent; else --- 6059,6067 ---- fill.Char.AsciiChar = ' '; if (!(vtp_working ! # ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) ! # endif )) fill.Attributes = g_attrCurrent; else *************** *** 6187,6195 **** return; if (!(vtp_working ! #ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) ! #endif )) { // There are reports of double-width characters not displayed --- 6187,6195 ---- return; if (!(vtp_working ! # ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) ! # endif )) { // There are reports of double-width characters not displayed *************** *** 6435,6443 **** } if (!(vtp_working ! #ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) ! #endif )) { FillConsoleOutputAttribute(g_hConOut, g_attrCurrent, cells, --- 6435,6443 ---- } if (!(vtp_working ! # ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) ! # endif )) { FillConsoleOutputAttribute(g_hConOut, g_attrCurrent, cells, *************** *** 6479,6487 **** // Cursor under VTP is always in the correct position, no need to reset. if (!(vtp_working ! #ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) ! #endif )) gotoxy(g_coord.X + 1, g_coord.Y + 1); --- 6479,6487 ---- // Cursor under VTP is always in the correct position, no need to reset. if (!(vtp_working ! # ifdef FEAT_TERMGUICOLORS && (p_tgc || t_colors >= 256) ! # endif )) gotoxy(g_coord.X + 1, g_coord.Y + 1); *** ../vim-9.0.0879/src/version.c 2022-11-14 14:50:11.924510877 +0000 --- src/version.c 2022-11-14 15:29:56.289555003 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 880, /**/ -- hundred-and-one symptoms of being an internet addict: 60. As your car crashes through the guardrail on a mountain road, your first instinct is to search for the "back" button. /// 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 ///