-*index.txt* For Vim version 9.1. Last change: 2023 Jul 06
+*index.txt* For Vim version 9.1. Last change: 2023 Jul 14
VIM REFERENCE MANUAL by Bram Moolenaar
search pattern and Visually select it
|gP| ["x]gP 2 put the text [from register x] before the
cursor N times, leave the cursor after it
-|gQ| gQ switch to "Ex" mode with Vim editing
+|gQ| gQ switch to "Ex" mode with Vim editing
|gR| gR 2 enter Virtual Replace mode
|gT| gT go to the previous tab page
|gU| gU{motion} 2 make Nmove text uppercase
if (cts.cts_text_prop_count)
{
- int write_idx = 0;
- for (int read_idx = 0; read_idx < cts.cts_text_prop_count; read_idx++)
- {
- textprop_T *tp = &cts.cts_text_props[read_idx];
- if (tp->tp_col != MAXCOL)
- {
- if (read_idx != write_idx)
- cts.cts_text_props[write_idx] = *tp;
- write_idx++;
- }
- }
- cts.cts_text_prop_count = write_idx;
- if (cts.cts_text_prop_count == 0)
- VIM_CLEAR(cts.cts_text_props);
+ int write_idx = 0;
+ for (int read_idx = 0; read_idx < cts.cts_text_prop_count; read_idx++)
+ {
+ textprop_T *tp = &cts.cts_text_props[read_idx];
+ if (tp->tp_col != MAXCOL)
+ {
+ if (read_idx != write_idx)
+ cts.cts_text_props[write_idx] = *tp;
+ write_idx++;
+ }
+ }
+ cts.cts_text_prop_count = write_idx;
+ if (cts.cts_text_prop_count == 0)
+ VIM_CLEAR(cts.cts_text_props);
}
win_linetabsize_cts(&cts, (colnr_T)MAXCOL);
r = (char_u *)"object of [unknown]";
}
else if (copyID != 0 && obj->obj_copyID == copyID
- && obj->obj_class->class_obj_member_count != 0)
+ && obj->obj_class->class_obj_member_count != 0)
{
size_t n = 25 + strlen((char *)obj->obj_class->class_name);
r = alloc(n);
// functions, check the arguments are not types.
if (!(func_allows_type(idx)))
{
- for (int i = 0; i < argcount; ++i)
- if (check_type_is_value(types[i].type_curr) == FAIL)
+ for (int i = 0; i < argcount; ++i)
+ if (check_type_is_value(types[i].type_curr) == FAIL)
return FAIL;
}
{
// The automatically inserted Visual area range is skipped, so that
// typing ":cmdmod cmd" in Visual mode works without having to move the
- // range to after the modififiers. The command will be
- // "'<,'>cmdmod cmd", parse "cmdmod cmd" and then put back "'<,'>"
- // before "cmd" below.
+ // range to after the modifiers. The command will be "'<,'>cmdmod cmd",
+ // parse "cmdmod cmd" and then put back "'<,'>" before "cmd" below.
eap->cmd += 5;
cmd_start = eap->cmd;
has_visual_range = TRUE;
ex_find(exarg_T *eap)
{
if (!check_can_set_curbuf_forceit(eap->forceit))
- return;
+ return;
char_u *fname;
int count;
// All other commands must obey 'winfixbuf' / ! rules
&& (is_other_file(0, ffname) && !check_can_set_curbuf_forceit(eap->forceit))
)
- return;
+ return;
do_exedit(eap, NULL);
}
ret = mch_lstat((char *)from, &st);
if (ret >= 0 && S_ISLNK(st.st_mode))
{
- ret = FAIL;
+ ret = FAIL;
len = readlink((char *)from, linkbuf, MAXPATHL);
if (len > 0)
vgetc_char = c;
}
- // 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;
*/
EXTERN int mod_mask INIT(= 0); // current key modifiers
-// The value of "mod_mask" and the unomdified character before calling
-// merge_modifyOtherKeys().
+// The value of "mod_mask" and the unmodified character in vgetc() after it has
+// called vgetorpeek() enough times.
EXTERN int vgetc_mod_mask INIT(= 0);
EXTERN int vgetc_char INIT(= 0);
// and in that case we don't want to overwrite ligatures map that has already
// been correctly populated (as that would lead to a cleared ligatures maps).
if (*p_guiligatures == NUL)
- CLEAR_FIELD(gui.ligatures_map);
+ CLEAR_FIELD(gui.ligatures_map);
#endif
#if defined(ALWAYS_USE_GUI) || defined(VIMDLL)
# if GTK_CHECK_VERSION(3,10,0)
static gboolean
scale_factor_event(GtkWidget *widget,
- GParamSpec* pspec UNUSED,
- gpointer user_data UNUSED)
+ GParamSpec* pspec UNUSED,
+ gpointer user_data UNUSED)
{
if (gui.surface != NULL)
cairo_surface_destroy(gui.surface);
# else
if (wp->w_briopt_vcol == 0)
prev_indent = get_indent_str(line,
- (int)wp->w_buffer->b_p_ts, no_ts);
+ (int)wp->w_buffer->b_p_ts, no_ts);
# endif
prev_tick = CHANGEDTICK(wp->w_buffer);
prev_listopt = wp->w_briopt_list;
char_u *line;
if (*(line = ml_get_buf(buf, lnum, FALSE)) == NUL)
- return 0;
+ return 0;
if (buf->b_ml.ml_line_textlen <= 0)
buf->b_ml.ml_line_textlen = (int)STRLEN(line) + 1;
SAFE_islower(cap->nchar) ? ACTION_SHOW : ACTION_GOTO,
cap->cmdchar == ']' ? curwin->w_cursor.lnum + 1 : (linenr_T)1,
(linenr_T)MAXLNUM,
- FALSE);
+ FALSE);
vim_free(ptr);
curwin->w_set_curswant = TRUE;
}
// Filter only on ANSI. Otherwise will see a lot of random fonts that we
// usually don't want.
if (lf->lfCharSet != ANSI_CHARSET)
- return 1;
+ return 1;
int (*add_match)(char_u *) = (int (*)(char_u *))lparam;
// Always fill in with the current font size as first option for
// convenience. We simply round to the closest integer for simplicity.
- int font_height = (int)round(
+ int font_height = (int)round(
pixels_to_points(-current_font_height, TRUE, (long_i)NULL));
vim_snprintf(buf, ARRAY_LENGTH(buf), "h%d", font_height);
add_match((char_u *)buf);
{
Gpm_Close(); // We don't want to talk to xterm via gpm
- // Gpm_Close fails to properly restore the WINCH and TSTP handlers,
- // leading to Vim ignoring resize signals. We have to re-initialize
- // these handlers again here.
+ // Gpm_Close fails to properly restore the WINCH and TSTP handlers,
+ // leading to Vim ignoring resize signals. We have to re-initialize
+ // these handlers again here.
# ifdef SIGWINCH
mch_signal(SIGWINCH, sig_winch);
# endif
else
#endif
attr = attrs[col - col_start];
- screen_puts_len(ptr, char_len, row, col, attr);
+ screen_puts_len(ptr, char_len, row, col, attr);
col += mb_ptr2cells(ptr);
ptr += char_len;
}
int j = 0;
if (str == NULL || pat == NULL)
- return NULL;
+ return NULL;
match_positions = ALLOC_ONE(garray_T);
if (match_positions == NULL)
- return NULL;
+ return NULL;
ga_init2(match_positions, sizeof(int_u), 10);
if (!fuzzy_match(str, pat, FALSE, &score, matches, MAX_FUZZY_MATCHES)
#endif
if (postponed_split == 0 && !check_can_set_curbuf_forceit(forceit))
- return FALSE;
+ return FALSE;
if (type == DT_HELP)
{
char_u *lbuf;
if (postponed_split == 0 && !check_can_set_curbuf_forceit(forceit))
- return FAIL;
+ return FAIL;
// Make a copy of the line, it can become invalid when an autocommand calls
// back here recursively.
help
let tf = tagfiles()
- " if 'helplang includes another language, then we may find
- " 2 tagfiles (e.g.: for EN and RU)
- " we may need to adjust this, if further translated help files are included
+ " If 'helplang' includes another language, then we may find 2 tagfiles
+ " (e.g.: for EN and RU).
+ " We may need to adjust this, if further translated help files are included.
call assert_inrange(1, 2, len(tf))
call assert_equal(fnamemodify(expand('$VIMRUNTIME/doc/tags'), ':p:gs?\\?/?'),
\ fnamemodify(tf[0], ':p:gs?\\?/?'))
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 581,
/**/
580,
/**/
{
ret_m = m;
ret_idx = i;
- break;
+ break;
}
}
if (idx != NULL)
}
}
else if (STRCMP(name, m->ocm_name) == 0)
- {
+ {
ret_m = m;
ret_idx = i;
- break;
- }
+ break;
+ }
}
if (idx != NULL)
*idx = ret_idx;
}
else
semsg(_(e_method_not_found_on_class_str_str), method_name,
- cl->class_name);
+ cl->class_name);
vim_free(method_name);
}
if (type->tt_type == VAR_OBJECT)
{
- ocmember_T *m = object_member_lookup(cl, name, len, &m_idx);
+ ocmember_T *m = object_member_lookup(cl, name, len, &m_idx);
if (m_idx >= 0)
{
if (*name == '_' && !inside_class(cctx, cl))