0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.4649: various formatting problems

Problem:    Various formatting problems.
Solution:   Improve the code formatting.
This commit is contained in:
Bram Moolenaar
2022-03-30 10:57:45 +01:00
parent 46eea444d9
commit b4ad3b0dea
9 changed files with 33 additions and 32 deletions

View File

@@ -1191,7 +1191,7 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx UNUSED)
#endif #endif
menu->parent = parent; menu->parent = parent;
menu->submenu_id = NULL; menu->submenu_id = (Widget)0;
if (!XtIsManaged(toolBar) if (!XtIsManaged(toolBar)
&& vim_strchr(p_go, GO_TOOLBAR) != NULL) && vim_strchr(p_go, GO_TOOLBAR) != NULL)
gui_mch_show_toolbar(TRUE); gui_mch_show_toolbar(TRUE);

View File

@@ -944,13 +944,21 @@ gui_mch_add_menu(vimmenu_T *menu, int idx)
&& tearoff_val == (int)XmTEAR_OFF_ENABLED ? 1 : 0), && tearoff_val == (int)XmTEAR_OFF_ENABLED ? 1 : 0),
#endif #endif
NULL); NULL);
gui_motif_menu_colors(menu->id);
gui_motif_menu_fontlist(menu->id);
XmStringFree(label); XmStringFree(label);
if (menu->id == (Widget)0) // failed if (menu->id == (Widget)0) // failed
return; return;
// The "Help" menu is a special case, and should be placed at the far
// right hand side of the menu-bar. It's recognized by its high priority.
if (parent == NULL && menu->priority >= 9999)
XtVaSetValues(menuBar,
XmNmenuHelpWidget, menu->id,
NULL);
gui_motif_menu_colors(menu->id);
gui_motif_menu_fontlist(menu->id);
// add accelerator text // add accelerator text
gui_motif_add_actext(menu); gui_motif_add_actext(menu);
@@ -978,19 +986,8 @@ gui_mch_add_menu(vimmenu_T *menu, int idx)
XmNsubMenuId, menu->submenu_id, XmNsubMenuId, menu->submenu_id,
NULL); NULL);
/* // When we add a top-level item to the menu bar, we can figure out how
* The "Help" menu is a special case, and should be placed at the far // high the menu bar should be.
* right hand side of the menu-bar. It's recognized by its high priority.
*/
if (parent == NULL && menu->priority >= 9999)
XtVaSetValues(menuBar,
XmNmenuHelpWidget, menu->id,
NULL);
/*
* When we add a top-level item to the menu bar, we can figure out how
* high the menu bar should be.
*/
if (parent == NULL) if (parent == NULL)
gui_mch_compute_menu_height(menu->id); gui_mch_compute_menu_height(menu->id);
} }

View File

@@ -1002,21 +1002,21 @@ mark_adjust(
void void
mark_adjust_nofold( mark_adjust_nofold(
linenr_T line1, linenr_T line1,
linenr_T line2, linenr_T line2,
long amount, long amount,
long amount_after) long amount_after)
{ {
mark_adjust_internal(line1, line2, amount, amount_after, FALSE); mark_adjust_internal(line1, line2, amount, amount_after, FALSE);
} }
static void static void
mark_adjust_internal( mark_adjust_internal(
linenr_T line1, linenr_T line1,
linenr_T line2, linenr_T line2,
long amount, long amount,
long amount_after, long amount_after,
int adjust_folds UNUSED) int adjust_folds UNUSED)
{ {
int i; int i;
int fnum = curbuf->b_fnum; int fnum = curbuf->b_fnum;

View File

@@ -3762,7 +3762,7 @@ get_tty_info(int fd, ttyinfo_T *info)
static int mouse_ison = FALSE; static int mouse_ison = FALSE;
/* /*
* Set mouse clicks on or off. * Set mouse clicks on or off and possible enable mouse movement events.
*/ */
void void
mch_setmouse(int on) mch_setmouse(int on)

View File

@@ -3194,6 +3194,7 @@ qf_jump_edit_buffer(
if (qfl_type == QFLT_LOCATION) if (qfl_type == QFLT_LOCATION)
{ {
win_T *wp = win_id2wp(prev_winid); win_T *wp = win_id2wp(prev_winid);
if (wp == NULL && curwin->w_llist != qi) if (wp == NULL && curwin->w_llist != qi)
{ {
emsg(_(e_current_window_was_closed)); emsg(_(e_current_window_was_closed));

View File

@@ -6764,8 +6764,10 @@ nfa_regmatch(
case NFA_MARK_GT: case NFA_MARK_GT:
case NFA_MARK_LT: case NFA_MARK_LT:
{ {
size_t col = rex.input - rex.line; pos_T *pos;
pos_T *pos = getmark_buf(rex.reg_buf, t->state->val, FALSE); size_t col = REG_MULTI ? rex.input - rex.line : 0;
pos = getmark_buf(rex.reg_buf, t->state->val, FALSE);
// Line may have been freed, get it again. // Line may have been freed, get it again.
if (REG_MULTI) if (REG_MULTI)

View File

@@ -2399,8 +2399,8 @@ ex_display(exarg_T *eap)
msg_puts_attr("^J", attr); msg_puts_attr("^J", attr);
n -= 2; n -= 2;
} }
for (p = yb->y_array[j]; *p && (n -= ptr2cells(p)) >= 0; for (p = yb->y_array[j];
++p) *p != NUL && (n -= ptr2cells(p)) >= 0; ++p)
{ {
clen = (*mb_ptr2len)(p); clen = (*mb_ptr2len)(p);
msg_outtrans_len(p, clen); msg_outtrans_len(p, clen);

View File

@@ -139,8 +139,7 @@ endfunc
func Test_FileChangedShell_edit_dialog() func Test_FileChangedShell_edit_dialog()
CheckNotGui CheckNotGui
" FIXME: why does this not work on MS-Windows? CheckUnix " Using low level feedkeys() does not work on MS-Windows.
CheckUnix
new Xchanged_r new Xchanged_r
call setline(1, 'reload this') call setline(1, 'reload this')

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
4649,
/**/ /**/
4648, 4648,
/**/ /**/