Skip to content

Commit 88456cd

Browse files
committed
patch 9.0.0904: various comment and indent flaws
Problem: Various comment and indent flaws. Solution: Improve comments and indenting.
1 parent d13166e commit 88456cd

14 files changed

Lines changed: 61 additions & 42 deletions

Filelist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ SRC_ALL = \
1212
.github/workflows/ci.yml \
1313
.github/workflows/codeql-analysis.yml \
1414
.github/workflows/coverity.yml \
15+
.github/dependabot.yml \
1516
.gitignore \
1617
.hgignore \
1718
.lgtm.yml \
@@ -396,6 +397,7 @@ SRC_ALL = \
396397
src/libvterm/t/66screen_extent.test \
397398
src/libvterm/t/67screen_dbl_wh.test \
398399
src/libvterm/t/68screen_termprops.test \
400+
src/libvterm/t/69screen_reflow.test \
399401
src/libvterm/t/90vttest_01-movement-1.test \
400402
src/libvterm/t/90vttest_01-movement-2.test \
401403
src/libvterm/t/90vttest_01-movement-3.test \
@@ -643,6 +645,7 @@ SRC_MAC = \
643645
src/os_mac_conv.c \
644646
src/os_macosx.m \
645647
src/proto/os_mac_conv.pro \
648+
src/proto/os_macosx.pro \
646649

647650
# source files for VMS (in the extra archive)
648651
SRC_VMS = \

src/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,9 @@ CClink = $(CC)
396396

397397
# MZSCHEME
398398
# Uncomment this when you want to include the MzScheme interface.
399-
# You may have to build racket from source to make this work.
399+
# You may have to build racket from source to make this work. Version 7.9 has
400+
# been reported to work, version 8.0 probably doesn't work, version 8.5 has
401+
# been reported to work.
400402
# NOTE: does not work well together with valgrind.
401403
#CONF_OPT_MZSCHEME = --enable-mzschemeinterp
402404
# PLT/mrscheme/drscheme Home dir; the PLTHOME environment variable also works

src/eval.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,6 @@ get_lval(
13661366
if (rettv != NULL && lp->ll_dict->dv_scope != 0)
13671367
{
13681368
int prevval;
1369-
int wrong;
13701369

13711370
if (len != -1)
13721371
{
@@ -1375,7 +1374,7 @@ get_lval(
13751374
}
13761375
else
13771376
prevval = 0; // avoid compiler warning
1378-
wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE
1377+
int wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE
13791378
&& (rettv->v_type == VAR_FUNC
13801379
|| rettv->v_type == VAR_PARTIAL)
13811380
&& var_wrong_func_name(key, lp->ll_di == NULL))

src/evalwindow.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ win_id2wp(int id)
8989

9090
/*
9191
* Return the window and tab pointer of window "id".
92+
* Returns NULL when not found.
9293
*/
9394
win_T *
9495
win_id2wp_tp(int id, tabpage_T **tpp)

src/getchar.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -968,18 +968,18 @@ noremap_keys(void)
968968
* Insert a string in position 'offset' in the typeahead buffer (for "@r"
969969
* and ":normal" command, vgetorpeek() and check_termcode()).
970970
*
971-
* If noremap is REMAP_YES, new string can be mapped again.
972-
* If noremap is REMAP_NONE, new string cannot be mapped again.
973-
* If noremap is REMAP_SKIP, first char of new string cannot be mapped again,
971+
* If "noremap" is REMAP_YES, new string can be mapped again.
972+
* If "noremap" is REMAP_NONE, new string cannot be mapped again.
973+
* If "noremap" is REMAP_SKIP, first char of new string cannot be mapped again,
974974
* but abbreviations are allowed.
975-
* If noremap is REMAP_SCRIPT, new string cannot be mapped again, except for
975+
* If "noremap" is REMAP_SCRIPT, new string cannot be mapped again, except for
976976
* script-local mappings.
977-
* If noremap is > 0, that many characters of the new string cannot be mapped.
977+
* If "noremap" is > 0, that many characters of the new string cannot be mapped.
978978
*
979-
* If nottyped is TRUE, the string does not return KeyTyped (don't use when
980-
* offset is non-zero!).
979+
* If "nottyped" is TRUE, the string does not return KeyTyped (don't use when
980+
* "offset" is non-zero!).
981981
*
982-
* If silent is TRUE, cmd_silent is set when the characters are obtained.
982+
* If "silent" is TRUE, cmd_silent is set when the characters are obtained.
983983
*
984984
* return FAIL for failure, OK otherwise
985985
*/
@@ -1601,8 +1601,8 @@ before_blocking(void)
16011601
}
16021602

16031603
/*
1604-
* updatescript() is called when a character can be written into the script file
1605-
* or when we have waited some time for a character (c == 0)
1604+
* updatescript() is called when a character can be written into the script
1605+
* file or when we have waited some time for a character (c == 0)
16061606
*
16071607
* All the changed memfiles are synced if c == 0 or when the number of typed
16081608
* characters reaches 'updatecount' and 'updatecount' is non-zero.

src/match.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ next_search_hl(
435435
colnr_T matchcol;
436436
long nmatched;
437437
int called_emsg_before = called_emsg;
438-
int timed_out = FALSE;
438+
int timed_out = FALSE;
439439

440440
// for :{range}s/pat only highlight inside the range
441441
if ((lnum < search_first_line || lnum > search_last_line) && cur == NULL)

src/message.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,9 +1311,8 @@ wait_return(int redraw)
13111311
|| c == K_X2MOUSE))
13121312
);
13131313
ui_breakcheck();
1314-
/*
1315-
* Avoid that the mouse-up event causes visual mode to start.
1316-
*/
1314+
1315+
// Avoid that the mouse-up event causes Visual mode to start.
13171316
if (c == K_LEFTMOUSE || c == K_MIDDLEMOUSE || c == K_RIGHTMOUSE
13181317
|| c == K_X1MOUSE || c == K_X2MOUSE)
13191318
(void)jump_to_mouse(MOUSE_SETPOS, NULL, 0);

src/move.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2852,7 +2852,8 @@ cursor_correct(void)
28522852
static void get_scroll_overlap(lineoff_T *lp, int dir);
28532853

28542854
/*
2855-
* Move screen "count" pages up or down and update screen.
2855+
* Move screen "count" pages up ("dir" is BACKWARD) or down ("dir" is FORWARD)
2856+
* and update the screen.
28562857
*
28572858
* Return FAIL for failure, OK otherwise.
28582859
*/

src/os_unix.c

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,6 +2352,7 @@ mch_restore_title(int which)
23522352

23532353
/*
23542354
* Return TRUE if "name" looks like some xterm name.
2355+
* This matches "xterm.*", thus "xterm-256color", "xterm-kitty", etc.
23552356
* Seiichi Sato mentioned that "mlterm" works like xterm.
23562357
*/
23572358
int
@@ -2409,6 +2410,9 @@ use_xterm_mouse(void)
24092410
return 0;
24102411
}
24112412

2413+
/*
2414+
* Return TRUE if "name" is an iris-ansi terminal name.
2415+
*/
24122416
int
24132417
vim_is_iris(char_u *name)
24142418
{
@@ -2418,14 +2422,18 @@ vim_is_iris(char_u *name)
24182422
|| STRCMP(name, "builtin_iris-ansi") == 0);
24192423
}
24202424

2425+
/*
2426+
* Return TRUE if "name" is a vt300-like terminal name.
2427+
*/
24212428
int
24222429
vim_is_vt300(char_u *name)
24232430
{
24242431
if (name == NULL)
2425-
return FALSE; // actually all ANSI comp. terminals should be here
2426-
// catch VT100 - VT5xx
2432+
return FALSE;
2433+
// Actually all ANSI compatible terminals should be here.
2434+
// Catch at least VT1xx - VT5xx
24272435
return ((STRNICMP(name, "vt", 2) == 0
2428-
&& vim_strchr((char_u *)"12345", name[2]) != NULL)
2436+
&& vim_strchr((char_u *)"12345", name[2]) != NULL)
24292437
|| STRCMP(name, "builtin_vt320") == 0);
24302438
}
24312439

@@ -5011,8 +5019,7 @@ mch_call_shell_fork(
50115019
|| (!curbuf->b_p_bin
50125020
&& curbuf->b_p_fixeol)
50135021
|| (lnum != curbuf->b_no_eol_lnum
5014-
&& (lnum !=
5015-
curbuf->b_ml.ml_line_count
5022+
&& (lnum != curbuf->b_ml.ml_line_count
50165023
|| curbuf->b_p_eol)))
50175024
vim_ignored = write(toshell_fd, "\n",
50185025
(size_t)1);
@@ -8309,8 +8316,8 @@ stop_timeout(void)
83098316
start_timeout(long msec)
83108317
{
83118318
struct itimerspec interval = {
8312-
{0, 0}, // Do not repeat.
8313-
{msec / 1000, (msec % 1000) * 1000000}}; // Timeout interval
8319+
{0, 0}, // Do not repeat.
8320+
{msec / 1000, (msec % 1000) * 1000000}}; // Timeout interval
83148321
int ret;
83158322

83168323
// This is really the caller's responsibility, but let's make sure the
@@ -8323,8 +8330,8 @@ start_timeout(long msec)
83238330

83248331
action.sigev_notify = SIGEV_THREAD;
83258332
action.sigev_notify_function = set_flag;
8326-
ret = timer_create(CLOCK_MONOTONIC, &action, &timer_id);
8327-
if (ret < 0)
8333+
ret = timer_create(CLOCK_MONOTONIC, &action, &timer_id);
8334+
if (ret < 0)
83288335
{
83298336
semsg(_(e_could_not_set_timeout_str), strerror(errno));
83308337
return &timeout_flag;
@@ -8362,10 +8369,10 @@ delete_timer(void)
83628369
* Implement timeout with setitimer()
83638370
*/
83648371
static struct sigaction prev_sigaction;
8365-
static volatile sig_atomic_t timeout_flag = FALSE;
8366-
static int timer_active = FALSE;
8372+
static volatile sig_atomic_t timeout_flag = FALSE;
8373+
static int timer_active = FALSE;
83678374
static int timer_handler_active = FALSE;
8368-
static volatile sig_atomic_t alarm_pending = FALSE;
8375+
static volatile sig_atomic_t alarm_pending = FALSE;
83698376

83708377
/*
83718378
* Handle SIGALRM for a timeout.
@@ -8424,8 +8431,8 @@ stop_timeout(void)
84248431
start_timeout(long msec)
84258432
{
84268433
struct itimerval interval = {
8427-
{0, 0}, // Do not repeat.
8428-
{msec / 1000, (msec % 1000) * 1000}}; // Timeout interval
8434+
{0, 0}, // Do not repeat.
8435+
{msec / 1000, (msec % 1000) * 1000}}; // Timeout interval
84298436
struct sigaction handle_alarm;
84308437
int ret;
84318438
sigset_t sigs;

src/regexp_nfa.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6782,8 +6782,7 @@ nfa_regmatch(
67826782
if (REG_MULTI && (lnum <= 0
67836783
|| lnum > wp->w_buffer->b_ml.ml_line_count))
67846784
lnum = 1;
6785-
vcol = (long_u)win_linetabsize(wp, lnum,
6786-
rex.line, col);
6785+
vcol = (long_u)win_linetabsize(wp, lnum, rex.line, col);
67876786
result = nfa_re_num_cmp(t->state->val, op, vcol + 1);
67886787
}
67896788
if (result)

0 commit comments

Comments
 (0)