Problem: Various comment and indent flaws.
Solution: Improve comments and indenting.
.github/workflows/ci.yml \
.github/workflows/codeql-analysis.yml \
.github/workflows/coverity.yml \
+ .github/dependabot.yml \
.gitignore \
.hgignore \
.lgtm.yml \
src/libvterm/t/66screen_extent.test \
src/libvterm/t/67screen_dbl_wh.test \
src/libvterm/t/68screen_termprops.test \
+ src/libvterm/t/69screen_reflow.test \
src/libvterm/t/90vttest_01-movement-1.test \
src/libvterm/t/90vttest_01-movement-2.test \
src/libvterm/t/90vttest_01-movement-3.test \
src/os_mac_conv.c \
src/os_macosx.m \
src/proto/os_mac_conv.pro \
+ src/proto/os_macosx.pro \
# source files for VMS (in the extra archive)
SRC_VMS = \
# MZSCHEME
# Uncomment this when you want to include the MzScheme interface.
-# You may have to build racket from source to make this work.
+# You may have to build racket from source to make this work. Version 7.9 has
+# been reported to work, version 8.0 probably doesn't work, version 8.5 has
+# been reported to work.
# NOTE: does not work well together with valgrind.
#CONF_OPT_MZSCHEME = --enable-mzschemeinterp
# PLT/mrscheme/drscheme Home dir; the PLTHOME environment variable also works
if (rettv != NULL && lp->ll_dict->dv_scope != 0)
{
int prevval;
- int wrong;
if (len != -1)
{
}
else
prevval = 0; // avoid compiler warning
- wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE
+ int wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE
&& (rettv->v_type == VAR_FUNC
|| rettv->v_type == VAR_PARTIAL)
&& var_wrong_func_name(key, lp->ll_di == NULL))
/*
* Return the window and tab pointer of window "id".
+ * Returns NULL when not found.
*/
win_T *
win_id2wp_tp(int id, tabpage_T **tpp)
* Insert a string in position 'offset' in the typeahead buffer (for "@r"
* and ":normal" command, vgetorpeek() and check_termcode()).
*
- * If noremap is REMAP_YES, new string can be mapped again.
- * If noremap is REMAP_NONE, new string cannot be mapped again.
- * If noremap is REMAP_SKIP, first char of new string cannot be mapped again,
+ * If "noremap" is REMAP_YES, new string can be mapped again.
+ * If "noremap" is REMAP_NONE, new string cannot be mapped again.
+ * If "noremap" is REMAP_SKIP, first char of new string cannot be mapped again,
* but abbreviations are allowed.
- * If noremap is REMAP_SCRIPT, new string cannot be mapped again, except for
+ * If "noremap" is REMAP_SCRIPT, new string cannot be mapped again, except for
* script-local mappings.
- * If noremap is > 0, that many characters of the new string cannot be mapped.
+ * If "noremap" is > 0, that many characters of the new string cannot be mapped.
*
- * If nottyped is TRUE, the string does not return KeyTyped (don't use when
- * offset is non-zero!).
+ * If "nottyped" is TRUE, the string does not return KeyTyped (don't use when
+ * "offset" is non-zero!).
*
- * If silent is TRUE, cmd_silent is set when the characters are obtained.
+ * If "silent" is TRUE, cmd_silent is set when the characters are obtained.
*
* return FAIL for failure, OK otherwise
*/
}
/*
- * updatescript() is called when a character can be written into the script file
- * or when we have waited some time for a character (c == 0)
+ * updatescript() is called when a character can be written into the script
+ * file or when we have waited some time for a character (c == 0)
*
* All the changed memfiles are synced if c == 0 or when the number of typed
* characters reaches 'updatecount' and 'updatecount' is non-zero.
colnr_T matchcol;
long nmatched;
int called_emsg_before = called_emsg;
- int timed_out = FALSE;
+ int timed_out = FALSE;
// for :{range}s/pat only highlight inside the range
if ((lnum < search_first_line || lnum > search_last_line) && cur == NULL)
|| c == K_X2MOUSE))
);
ui_breakcheck();
- /*
- * Avoid that the mouse-up event causes visual mode to start.
- */
+
+ // Avoid that the mouse-up event causes Visual mode to start.
if (c == K_LEFTMOUSE || c == K_MIDDLEMOUSE || c == K_RIGHTMOUSE
|| c == K_X1MOUSE || c == K_X2MOUSE)
(void)jump_to_mouse(MOUSE_SETPOS, NULL, 0);
static void get_scroll_overlap(lineoff_T *lp, int dir);
/*
- * Move screen "count" pages up or down and update screen.
+ * Move screen "count" pages up ("dir" is BACKWARD) or down ("dir" is FORWARD)
+ * and update the screen.
*
* Return FAIL for failure, OK otherwise.
*/
/*
* Return TRUE if "name" looks like some xterm name.
+ * This matches "xterm.*", thus "xterm-256color", "xterm-kitty", etc.
* Seiichi Sato mentioned that "mlterm" works like xterm.
*/
int
return 0;
}
+/*
+ * Return TRUE if "name" is an iris-ansi terminal name.
+ */
int
vim_is_iris(char_u *name)
{
|| STRCMP(name, "builtin_iris-ansi") == 0);
}
+/*
+ * Return TRUE if "name" is a vt300-like terminal name.
+ */
int
vim_is_vt300(char_u *name)
{
if (name == NULL)
- return FALSE; // actually all ANSI comp. terminals should be here
- // catch VT100 - VT5xx
+ return FALSE;
+ // Actually all ANSI compatible terminals should be here.
+ // Catch at least VT1xx - VT5xx
return ((STRNICMP(name, "vt", 2) == 0
- && vim_strchr((char_u *)"12345", name[2]) != NULL)
+ && vim_strchr((char_u *)"12345", name[2]) != NULL)
|| STRCMP(name, "builtin_vt320") == 0);
}
|| (!curbuf->b_p_bin
&& curbuf->b_p_fixeol)
|| (lnum != curbuf->b_no_eol_lnum
- && (lnum !=
- curbuf->b_ml.ml_line_count
+ && (lnum != curbuf->b_ml.ml_line_count
|| curbuf->b_p_eol)))
vim_ignored = write(toshell_fd, "\n",
(size_t)1);
start_timeout(long msec)
{
struct itimerspec interval = {
- {0, 0}, // Do not repeat.
- {msec / 1000, (msec % 1000) * 1000000}}; // Timeout interval
+ {0, 0}, // Do not repeat.
+ {msec / 1000, (msec % 1000) * 1000000}}; // Timeout interval
int ret;
// This is really the caller's responsibility, but let's make sure the
action.sigev_notify = SIGEV_THREAD;
action.sigev_notify_function = set_flag;
- ret = timer_create(CLOCK_MONOTONIC, &action, &timer_id);
- if (ret < 0)
+ ret = timer_create(CLOCK_MONOTONIC, &action, &timer_id);
+ if (ret < 0)
{
semsg(_(e_could_not_set_timeout_str), strerror(errno));
return &timeout_flag;
* Implement timeout with setitimer()
*/
static struct sigaction prev_sigaction;
-static volatile sig_atomic_t timeout_flag = FALSE;
-static int timer_active = FALSE;
+static volatile sig_atomic_t timeout_flag = FALSE;
+static int timer_active = FALSE;
static int timer_handler_active = FALSE;
-static volatile sig_atomic_t alarm_pending = FALSE;
+static volatile sig_atomic_t alarm_pending = FALSE;
/*
* Handle SIGALRM for a timeout.
start_timeout(long msec)
{
struct itimerval interval = {
- {0, 0}, // Do not repeat.
- {msec / 1000, (msec % 1000) * 1000}}; // Timeout interval
+ {0, 0}, // Do not repeat.
+ {msec / 1000, (msec % 1000) * 1000}}; // Timeout interval
struct sigaction handle_alarm;
int ret;
sigset_t sigs;
if (REG_MULTI && (lnum <= 0
|| lnum > wp->w_buffer->b_ml.ml_line_count))
lnum = 1;
- vcol = (long_u)win_linetabsize(wp, lnum,
- rex.line, col);
+ vcol = (long_u)win_linetabsize(wp, lnum, rex.line, col);
result = nfa_re_num_cmp(t->state->val, op, vcol + 1);
}
if (result)
call s:concat_files('XXMac', 'XXEol', 'XXMacEol')
call s:concat_files('XXUxDs', 'XXMac', 'XXUxDsMc')
- new
+ " The :bwipe commands below cause us to get back to the current buffer.
+ " Avoid stray errors for various 'fileformat' values which may cause a
+ " modeline to be misinterpreted by wiping the buffer and editing a new one.
+ only!
+ bwipe!
+ enew
" Test 1: try reading and writing with 'fileformats' empty
set fileformats=
-" Test to verify that the three function lists,
+" Test to verify that the three function lists:
"
-" global_functions[] in src/evalfunc.c
-" *functions* in runtime/doc/builtin.txt
-" *function-list* in runtime/doc/usr_41.txt
+" - global_functions[] in src/evalfunc.c
+" - *functions* in runtime/doc/builtin.txt
+" - *function-list* in runtime/doc/usr_41.txt
"
-" contain the same functions and that the global_functions and ":help
-" functions" lists are in ASCII order.
+" contain the same functions and that the global_functions and
+" ":help functions" lists are in ASCII order.
func Test_function_lists()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 904,
/**/
903,
/**/
/*
* Convert from the active codepage to 'encoding'.
* Input is "str[str_size]".
- * The result is in allocated memory: "out[outlen]". With terminating NUL.
+ * The result is in allocated memory: "out[outlen]". "outlen" includes the
+ * terminating NUL.
*/
void
acp_to_enc(