1
0
forked from aniani/vim

patch 8.1.1000: indenting is off

Problem:    Indenting is off.
Solution:   Make indenting consistent and update comments. (Ozaki Kiichi,
            closes #4079)
This commit is contained in:
Bram Moolenaar 2019-03-09 11:23:58 +01:00
parent 9d7fdd403a
commit fd731b0e31
3 changed files with 149 additions and 141 deletions

View File

@ -1579,7 +1579,7 @@ vgetc(void)
{
mod_mask = 0x0;
last_recorded_len = 0;
for (;;) /* this is done twice if there are modifiers */
for (;;) // this is done twice if there are modifiers
{
int did_inc = FALSE;
@ -1589,10 +1589,10 @@ vgetc(void)
#endif
)
{
/* no mapping after modifier has been read */
// no mapping after modifier has been read
++no_mapping;
++allow_keys;
did_inc = TRUE; /* mod_mask may change value */
did_inc = TRUE; // mod_mask may change value
}
c = vgetorpeek(TRUE);
if (did_inc)
@ -1601,7 +1601,7 @@ vgetc(void)
--allow_keys;
}
/* Get two extra bytes for special keys */
// Get two extra bytes for special keys
if (c == K_SPECIAL
#ifdef FEAT_GUI
|| c == CSI
@ -1611,8 +1611,8 @@ vgetc(void)
int save_allow_keys = allow_keys;
++no_mapping;
allow_keys = 0; /* make sure BS is not found */
c2 = vgetorpeek(TRUE); /* no mapping for these chars */
allow_keys = 0; // make sure BS is not found
c2 = vgetorpeek(TRUE); // no mapping for these chars
c = vgetorpeek(TRUE);
--no_mapping;
allow_keys = save_allow_keys;
@ -1624,14 +1624,14 @@ vgetc(void)
c = TO_SPECIAL(c2, c);
#if defined(FEAT_GUI_MSWIN) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
/* Handle K_TEAROFF here, the caller of vgetc() doesn't need to
* know that a menu was torn off */
// Handle K_TEAROFF here, the caller of vgetc() doesn't need to
// know that a menu was torn off
if (c == K_TEAROFF)
{
char_u name[200];
int i;
/* get menu path, it ends with a <CR> */
// get menu path, it ends with a <CR>
for (i = 0; (c = vgetorpeek(TRUE)) != '\r'; )
{
name[i] = c;
@ -1644,33 +1644,34 @@ vgetc(void)
}
#endif
#if defined(FEAT_GUI) && defined(FEAT_GUI_GTK) && defined(FEAT_MENU)
/* GTK: <F10> normally selects the menu, but it's passed until
* here to allow mapping it. Intercept and invoke the GTK
* behavior if it's not mapped. */
// GTK: <F10> normally selects the menu, but it's passed until
// here to allow mapping it. Intercept and invoke the GTK
// behavior if it's not mapped.
if (c == K_F10 && gui.menubar != NULL)
{
gtk_menu_shell_select_first(GTK_MENU_SHELL(gui.menubar), FALSE);
gtk_menu_shell_select_first(
GTK_MENU_SHELL(gui.menubar), FALSE);
continue;
}
#endif
#ifdef FEAT_GUI
/* Handle focus event here, so that the caller doesn't need to
* know about it. Return K_IGNORE so that we loop once (needed if
* 'lazyredraw' is set). */
// Handle focus event here, so that the caller doesn't need to
// know about it. Return K_IGNORE so that we loop once (needed
// if 'lazyredraw' is set).
if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
{
ui_focus_change(c == K_FOCUSGAINED);
c = K_IGNORE;
}
/* Translate K_CSI to CSI. The special key is only used to avoid
* it being recognized as the start of a special key. */
// Translate K_CSI to CSI. The special key is only used to
// avoid it being recognized as the start of a special key.
if (c == K_CSI)
c = CSI;
#endif
}
/* a keypad or special function key was not mapped, use it like
* its ASCII equivalent */
// a keypad or special function key was not mapped, use it like
// its ASCII equivalent
switch (c)
{
case K_KPLUS: c = '+'; break;
@ -1732,10 +1733,9 @@ vgetc(void)
case K_XRIGHT: c = K_RIGHT; break;
}
/* For a multi-byte character get all the bytes and return the
* converted character.
* Note: This will loop until enough bytes are received!
*/
// For a multi-byte character get all the bytes and return the
// converted character.
// Note: This will loop until enough bytes are received!
if (has_mbyte && (n = MB_BYTE2LEN_CHECK(c)) > 1)
{
++no_mapping;
@ -1749,11 +1749,12 @@ vgetc(void)
#endif
)
{
/* Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER sequence,
* which represents a K_SPECIAL (0x80),
* or a CSI - KS_EXTRA - KE_CSI sequence, which represents
* a CSI (0x9B),
* of a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI too. */
// Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER
// sequence, which represents a K_SPECIAL (0x80),
// or a CSI - KS_EXTRA - KE_CSI sequence, which
// represents a CSI (0x9B),
// or a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI
// too.
c = vgetorpeek(TRUE);
if (vgetorpeek(TRUE) == (int)KE_CSI && c == KS_EXTRA)
buf[i] = CSI;

View File

@ -1245,10 +1245,15 @@ do_execreg(
emsg(_(e_nolastcmd));
return FAIL;
}
VIM_CLEAR(new_last_cmdline); /* don't keep the cmdline containing @: */
/* Escape all control characters with a CTRL-V */
// don't keep the cmdline containing @:
VIM_CLEAR(new_last_cmdline);
// Escape all control characters with a CTRL-V
p = vim_strsave_escaped_ext(last_cmdline,
(char_u *)"\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", Ctrl_V, FALSE);
(char_u *)"\001\002\003\004\005\006\007"
"\010\011\012\013\014\015\016\017"
"\020\021\022\023\024\025\026\027"
"\030\031\032\033\034\035\036\037",
Ctrl_V, FALSE);
if (p != NULL)
{
/* When in Visual mode "'<,'>" will be prepended to the command.

View File

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