mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
vim-patch:8.1.2392: using old C style comments
Problem: Using old C style comments.
Solution: Use // comments where appropriate.
6e0ce171e1
This commit is contained in:
@@ -349,8 +349,8 @@ static const struct nv_cmd {
|
|||||||
// Sorted index of commands in nv_cmds[].
|
// Sorted index of commands in nv_cmds[].
|
||||||
static short nv_cmd_idx[NV_CMDS_SIZE];
|
static short nv_cmd_idx[NV_CMDS_SIZE];
|
||||||
|
|
||||||
/* The highest index for which
|
// The highest index for which
|
||||||
* nv_cmds[idx].cmd_char == nv_cmd_idx[nv_cmds[idx].cmd_char] */
|
// nv_cmds[idx].cmd_char == nv_cmd_idx[nv_cmds[idx].cmd_char]
|
||||||
static int nv_max_linear;
|
static int nv_max_linear;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -3623,8 +3623,8 @@ void do_check_scrollbind(bool check)
|
|||||||
static colnr_T old_leftcol = 0;
|
static colnr_T old_leftcol = 0;
|
||||||
|
|
||||||
if (check && curwin->w_p_scb) {
|
if (check && curwin->w_p_scb) {
|
||||||
/* If a ":syncbind" command was just used, don't scroll, only reset
|
// If a ":syncbind" command was just used, don't scroll, only reset
|
||||||
* the values. */
|
// the values.
|
||||||
if (did_syncbind) {
|
if (did_syncbind) {
|
||||||
did_syncbind = false;
|
did_syncbind = false;
|
||||||
} else if (curwin == old_curwin) {
|
} else if (curwin == old_curwin) {
|
||||||
@@ -4264,8 +4264,8 @@ void scroll_redraw(int up, long count)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Mark w_topline as valid, otherwise the screen jumps back at the
|
// Mark w_topline as valid, otherwise the screen jumps back at the
|
||||||
* end of the file. */
|
// end of the file.
|
||||||
check_cursor_moved(curwin);
|
check_cursor_moved(curwin);
|
||||||
curwin->w_valid |= VALID_TOPLINE;
|
curwin->w_valid |= VALID_TOPLINE;
|
||||||
}
|
}
|
||||||
@@ -4712,9 +4712,9 @@ dozet:
|
|||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
pos_T pos = curwin->w_cursor;
|
pos_T pos = curwin->w_cursor;
|
||||||
|
|
||||||
/* Find bad word under the cursor. When 'spell' is
|
// Find bad word under the cursor. When 'spell' is
|
||||||
* off this fails and find_ident_under_cursor() is
|
// off this fails and find_ident_under_cursor() is
|
||||||
* used below. */
|
// used below.
|
||||||
emsg_off++;
|
emsg_off++;
|
||||||
len = spell_move_to(curwin, FORWARD, true, true, NULL);
|
len = spell_move_to(curwin, FORWARD, true, true, NULL);
|
||||||
emsg_off--;
|
emsg_off--;
|
||||||
@@ -4833,10 +4833,8 @@ static void nv_colon(cmdarg_T *cap)
|
|||||||
&& (cap->oap->start.lnum > curbuf->b_ml.ml_line_count
|
&& (cap->oap->start.lnum > curbuf->b_ml.ml_line_count
|
||||||
|| cap->oap->start.col >
|
|| cap->oap->start.col >
|
||||||
(colnr_T)STRLEN(ml_get(cap->oap->start.lnum))
|
(colnr_T)STRLEN(ml_get(cap->oap->start.lnum))
|
||||||
|| did_emsg
|
|| did_emsg)) {
|
||||||
)) {
|
// The start of the operator has become invalid by the Ex command.
|
||||||
/* The start of the operator has become invalid by the Ex command.
|
|
||||||
*/
|
|
||||||
clearopbeep(cap->oap);
|
clearopbeep(cap->oap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5667,8 +5665,8 @@ static int normal_search(cmdarg_T *cap, int dir, char_u *pat, int opt, int *wrap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* "/$" will put the cursor after the end of the line, may need to
|
// "/$" will put the cursor after the end of the line, may need to
|
||||||
* correct that here */
|
// correct that here
|
||||||
check_cursor();
|
check_cursor();
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -5848,16 +5846,15 @@ static void nv_brackets(cmdarg_T *cap)
|
|||||||
}
|
}
|
||||||
c = gchar_cursor();
|
c = gchar_cursor();
|
||||||
if (c == '{' || c == '}') {
|
if (c == '{' || c == '}') {
|
||||||
/* Must have found end/start of class: use it.
|
// Must have found end/start of class: use it.
|
||||||
* Or found the place to be at. */
|
// Or found the place to be at.
|
||||||
if ((c == findc && norm) || (n == 1 && !norm)) {
|
if ((c == findc && norm) || (n == 1 && !norm)) {
|
||||||
new_pos = curwin->w_cursor;
|
new_pos = curwin->w_cursor;
|
||||||
pos = &new_pos;
|
pos = &new_pos;
|
||||||
n = 0;
|
n = 0;
|
||||||
}
|
} else if (new_pos.lnum == 0) {
|
||||||
/* if no match found at all, we started outside of the
|
// if no match found at all, we started outside of the
|
||||||
* class and we're inside now. Just go on. */
|
// class and we're inside now. Just go on.
|
||||||
else if (new_pos.lnum == 0) {
|
|
||||||
new_pos = curwin->w_cursor;
|
new_pos = curwin->w_cursor;
|
||||||
pos = &new_pos;
|
pos = &new_pos;
|
||||||
}
|
}
|
||||||
@@ -6306,8 +6303,8 @@ static void v_swap_corners(int cmdchar)
|
|||||||
|
|
||||||
curwin->w_cursor.lnum = old_cursor.lnum;
|
curwin->w_cursor.lnum = old_cursor.lnum;
|
||||||
curwin->w_curswant = right;
|
curwin->w_curswant = right;
|
||||||
/* 'selection "exclusive" and cursor at right-bottom corner: move it
|
// 'selection "exclusive" and cursor at right-bottom corner: move it
|
||||||
* right one column */
|
// right one column
|
||||||
if (old_cursor.lnum >= VIsual.lnum && *p_sel == 'e') {
|
if (old_cursor.lnum >= VIsual.lnum && *p_sel == 'e') {
|
||||||
++curwin->w_curswant;
|
++curwin->w_curswant;
|
||||||
}
|
}
|
||||||
@@ -6479,8 +6476,8 @@ static void v_visop(cmdarg_T *cap)
|
|||||||
{
|
{
|
||||||
static char_u trans[] = "YyDdCcxdXdAAIIrr";
|
static char_u trans[] = "YyDdCcxdXdAAIIrr";
|
||||||
|
|
||||||
/* Uppercase means linewise, except in block mode, then "D" deletes till
|
// Uppercase means linewise, except in block mode, then "D" deletes till
|
||||||
* the end of the line, and "C" replaces till EOL */
|
// the end of the line, and "C" replaces till EOL
|
||||||
if (isupper(cap->cmdchar)) {
|
if (isupper(cap->cmdchar)) {
|
||||||
if (VIsual_mode != Ctrl_V) {
|
if (VIsual_mode != Ctrl_V) {
|
||||||
VIsual_mode_orig = VIsual_mode;
|
VIsual_mode_orig = VIsual_mode;
|
||||||
@@ -6912,8 +6909,8 @@ static void nv_g_cmd(cmdarg_T *cap)
|
|||||||
VIsual_active = true;
|
VIsual_active = true;
|
||||||
VIsual_reselect = true;
|
VIsual_reselect = true;
|
||||||
|
|
||||||
/* Set Visual to the start and w_cursor to the end of the Visual
|
// Set Visual to the start and w_cursor to the end of the Visual
|
||||||
* area. Make sure they are on an existing character. */
|
// area. Make sure they are on an existing character.
|
||||||
check_cursor();
|
check_cursor();
|
||||||
VIsual = curwin->w_cursor;
|
VIsual = curwin->w_cursor;
|
||||||
curwin->w_cursor = tpos;
|
curwin->w_cursor = tpos;
|
||||||
@@ -6956,10 +6953,9 @@ static void nv_g_cmd(cmdarg_T *cap)
|
|||||||
nv_visual(cap);
|
nv_visual(cap);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* "gn", "gN" visually select next/previous search match
|
// "gn", "gN" visually select next/previous search match
|
||||||
* "gn" selects next match
|
// "gn" selects next match
|
||||||
* "gN" selects previous match
|
// "gN" selects previous match
|
||||||
*/
|
|
||||||
case 'N':
|
case 'N':
|
||||||
case 'n':
|
case 'n':
|
||||||
if (!current_search(cap->count1, cap->nchar == 'n')) {
|
if (!current_search(cap->count1, cap->nchar == 'n')) {
|
||||||
@@ -7033,9 +7029,9 @@ static void nv_g_cmd(cmdarg_T *cap)
|
|||||||
} else {
|
} else {
|
||||||
i = curwin->w_leftcol;
|
i = curwin->w_leftcol;
|
||||||
}
|
}
|
||||||
/* Go to the middle of the screen line. When 'number' or
|
// Go to the middle of the screen line. When 'number' or
|
||||||
* 'relativenumber' is on and lines are wrapping the middle can be more
|
// 'relativenumber' is on and lines are wrapping the middle can be more
|
||||||
* to the left. */
|
// to the left.
|
||||||
if (cap->nchar == 'm') {
|
if (cap->nchar == 'm') {
|
||||||
i += (curwin->w_width_inner - curwin_col_off()
|
i += (curwin->w_width_inner - curwin_col_off()
|
||||||
+ ((curwin->w_p_wrap && i > 0)
|
+ ((curwin->w_p_wrap && i > 0)
|
||||||
@@ -7683,11 +7679,10 @@ static void nv_wordcmd(cmdarg_T *cap)
|
|||||||
*/
|
*/
|
||||||
static void adjust_cursor(oparg_T *oap)
|
static void adjust_cursor(oparg_T *oap)
|
||||||
{
|
{
|
||||||
/* The cursor cannot remain on the NUL when:
|
// The cursor cannot remain on the NUL when:
|
||||||
* - the column is > 0
|
// - the column is > 0
|
||||||
* - not in Visual mode or 'selection' is "o"
|
// - not in Visual mode or 'selection' is "o"
|
||||||
* - 'virtualedit' is not "all" and not "onemore".
|
// - 'virtualedit' is not "all" and not "onemore".
|
||||||
*/
|
|
||||||
if (curwin->w_cursor.col > 0 && gchar_cursor() == NUL
|
if (curwin->w_cursor.col > 0 && gchar_cursor() == NUL
|
||||||
&& (!VIsual_active || *p_sel == 'o')
|
&& (!VIsual_active || *p_sel == 'o')
|
||||||
&& !virtual_active() &&
|
&& !virtual_active() &&
|
||||||
@@ -7956,8 +7951,8 @@ static void nv_edit(cmdarg_T *cap)
|
|||||||
if (curwin->w_cursor.coladd && cap->cmdchar != 'A') {
|
if (curwin->w_cursor.coladd && cap->cmdchar != 'A') {
|
||||||
int save_State = State;
|
int save_State = State;
|
||||||
|
|
||||||
/* Pretend Insert mode here to allow the cursor on the
|
// Pretend Insert mode here to allow the cursor on the
|
||||||
* character past the end of the line */
|
// character past the end of the line
|
||||||
State = INSERT;
|
State = INSERT;
|
||||||
coladvance(getviscol());
|
coladvance(getviscol());
|
||||||
State = save_State;
|
State = save_State;
|
||||||
@@ -7974,9 +7969,9 @@ static void invoke_edit(cmdarg_T *cap, int repl, int cmd, int startln)
|
|||||||
{
|
{
|
||||||
int restart_edit_save = 0;
|
int restart_edit_save = 0;
|
||||||
|
|
||||||
/* Complicated: When the user types "a<C-O>a" we don't want to do Insert
|
// Complicated: When the user types "a<C-O>a" we don't want to do Insert
|
||||||
* mode recursively. But when doing "a<C-O>." or "a<C-O>rx" we do allow
|
// mode recursively. But when doing "a<C-O>." or "a<C-O>rx" we do allow
|
||||||
* it. */
|
// it.
|
||||||
if (repl || !stuff_empty()) {
|
if (repl || !stuff_empty()) {
|
||||||
restart_edit_save = restart_edit;
|
restart_edit_save = restart_edit;
|
||||||
} else {
|
} else {
|
||||||
@@ -8260,8 +8255,8 @@ static void nv_put_opt(cmdarg_T *cap, bool fix_indent)
|
|||||||
&& curwin->w_cursor.col < curbuf->b_op_start.col)
|
&& curwin->w_cursor.col < curbuf->b_op_start.col)
|
||||||
|| (VIsual_mode == 'V'
|
|| (VIsual_mode == 'V'
|
||||||
&& curwin->w_cursor.lnum < curbuf->b_op_start.lnum)) {
|
&& curwin->w_cursor.lnum < curbuf->b_op_start.lnum)) {
|
||||||
/* cursor is at the end of the line or end of file, put
|
// cursor is at the end of the line or end of file, put
|
||||||
* forward. */
|
// forward.
|
||||||
dir = FORWARD;
|
dir = FORWARD;
|
||||||
}
|
}
|
||||||
// May have been reset in do_put().
|
// May have been reset in do_put().
|
||||||
@@ -8275,8 +8270,8 @@ static void nv_put_opt(cmdarg_T *cap, bool fix_indent)
|
|||||||
xfree(savereg);
|
xfree(savereg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* What to reselect with "gv"? Selecting the just put text seems to
|
// What to reselect with "gv"? Selecting the just put text seems to
|
||||||
* be the most useful, since the original text was removed. */
|
// be the most useful, since the original text was removed.
|
||||||
if (was_visual) {
|
if (was_visual) {
|
||||||
curbuf->b_visual.vi_start = curbuf->b_op_start;
|
curbuf->b_visual.vi_start = curbuf->b_op_start;
|
||||||
curbuf->b_visual.vi_end = curbuf->b_op_end;
|
curbuf->b_visual.vi_end = curbuf->b_op_end;
|
||||||
|
@@ -435,9 +435,9 @@ static void shift_block(oparg_T *oap, int amount)
|
|||||||
* non-whitespace character.
|
* non-whitespace character.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* If "bd.startspaces" is set, "bd.textstart" points to the character,
|
// If "bd.startspaces" is set, "bd.textstart" points to the character,
|
||||||
* the part of which is displayed at the block's beginning. Let's start
|
// the part of which is displayed at the block's beginning. Let's start
|
||||||
* searching from the next character. */
|
// searching from the next character.
|
||||||
if (bd.startspaces) {
|
if (bd.startspaces) {
|
||||||
MB_PTR_ADV(non_white);
|
MB_PTR_ADV(non_white);
|
||||||
}
|
}
|
||||||
@@ -614,8 +614,8 @@ static void block_insert(oparg_T *oap, char_u *s, int b_insert, struct block_def
|
|||||||
skipped, offset-startcol, kExtmarkUndo);
|
skipped, offset-startcol, kExtmarkUndo);
|
||||||
|
|
||||||
if (lnum == oap->end.lnum) {
|
if (lnum == oap->end.lnum) {
|
||||||
/* Set "']" mark to the end of the block instead of the end of
|
// Set "']" mark to the end of the block instead of the end of
|
||||||
* the insert in the first line. */
|
// the insert in the first line.
|
||||||
curbuf->b_op_end.lnum = oap->end.lnum;
|
curbuf->b_op_end.lnum = oap->end.lnum;
|
||||||
curbuf->b_op_end.col = offset;
|
curbuf->b_op_end.col = offset;
|
||||||
}
|
}
|
||||||
@@ -1846,8 +1846,8 @@ int op_replace(oparg_T *oap, int c)
|
|||||||
numc -= (oap->end_vcol - bd.end_vcol) + 1;
|
numc -= (oap->end_vcol - bd.end_vcol) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A double-wide character can be replaced only up to half the
|
// A double-wide character can be replaced only up to half the
|
||||||
* times. */
|
// times.
|
||||||
if ((*mb_char2cells)(c) > 1) {
|
if ((*mb_char2cells)(c) > 1) {
|
||||||
if ((numc & 1) && !bd.is_short) {
|
if ((numc & 1) && !bd.is_short) {
|
||||||
++bd.endspaces;
|
++bd.endspaces;
|
||||||
@@ -1938,8 +1938,8 @@ int op_replace(oparg_T *oap, int c)
|
|||||||
n = gchar_cursor();
|
n = gchar_cursor();
|
||||||
if (n != NUL) {
|
if (n != NUL) {
|
||||||
if ((*mb_char2len)(c) > 1 || (*mb_char2len)(n) > 1) {
|
if ((*mb_char2len)(c) > 1 || (*mb_char2len)(n) > 1) {
|
||||||
/* This is slow, but it handles replacing a single-byte
|
// This is slow, but it handles replacing a single-byte
|
||||||
* with a multi-byte and the other way around. */
|
// with a multi-byte and the other way around.
|
||||||
if (curwin->w_cursor.lnum == oap->end.lnum) {
|
if (curwin->w_cursor.lnum == oap->end.lnum) {
|
||||||
oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n);
|
oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n);
|
||||||
}
|
}
|
||||||
@@ -1949,8 +1949,8 @@ int op_replace(oparg_T *oap, int c)
|
|||||||
int end_vcol = 0;
|
int end_vcol = 0;
|
||||||
|
|
||||||
if (curwin->w_cursor.lnum == oap->end.lnum) {
|
if (curwin->w_cursor.lnum == oap->end.lnum) {
|
||||||
/* oap->end has to be recalculated when
|
// oap->end has to be recalculated when
|
||||||
* the tab breaks */
|
// the tab breaks
|
||||||
end_vcol = getviscol2(oap->end.col,
|
end_vcol = getviscol2(oap->end.col,
|
||||||
oap->end.coladd);
|
oap->end.coladd);
|
||||||
}
|
}
|
||||||
@@ -1969,9 +1969,9 @@ int op_replace(oparg_T *oap, int c)
|
|||||||
virtcols -= oap->start.coladd;
|
virtcols -= oap->start.coladd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* oap->end has been trimmed so it's effectively inclusive;
|
// oap->end has been trimmed so it's effectively inclusive;
|
||||||
* as a result an extra +1 must be counted so we don't
|
// as a result an extra +1 must be counted so we don't
|
||||||
* trample the NUL byte. */
|
// trample the NUL byte.
|
||||||
coladvance_force(getviscol2(oap->end.col, oap->end.coladd) + 1);
|
coladvance_force(getviscol2(oap->end.col, oap->end.coladd) + 1);
|
||||||
curwin->w_cursor.col -= (virtcols + 1);
|
curwin->w_cursor.col -= (virtcols + 1);
|
||||||
for (; virtcols >= 0; virtcols--) {
|
for (; virtcols >= 0; virtcols--) {
|
||||||
@@ -2228,8 +2228,8 @@ void op_insert(oparg_T *oap, long count1)
|
|||||||
++curwin->w_cursor.col;
|
++curwin->w_cursor.col;
|
||||||
}
|
}
|
||||||
if (bd.is_short && !bd.is_MAX) {
|
if (bd.is_short && !bd.is_MAX) {
|
||||||
/* First line was too short, make it longer and adjust the
|
// First line was too short, make it longer and adjust the
|
||||||
* values in "bd". */
|
// values in "bd".
|
||||||
if (u_save_cursor() == FAIL) {
|
if (u_save_cursor() == FAIL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2386,8 +2386,8 @@ int op_change(oparg_T *oap)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First delete the text in the region. In an empty buffer only need to
|
// First delete the text in the region. In an empty buffer only need to
|
||||||
* save for undo */
|
// save for undo
|
||||||
if (curbuf->b_ml.ml_flags & ML_EMPTY) {
|
if (curbuf->b_ml.ml_flags & ML_EMPTY) {
|
||||||
if (u_save_cursor() == FAIL) {
|
if (u_save_cursor() == FAIL) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -3872,10 +3872,9 @@ char_u *skip_comment(char_u *line, bool process, bool include_space, bool *is_co
|
|||||||
++comment_flags;
|
++comment_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we found a colon, it means that we are not processing a line
|
// If we found a colon, it means that we are not processing a line
|
||||||
* starting with a closing part of a three-part comment. That's good,
|
// starting with a closing part of a three-part comment. That's good,
|
||||||
* because we don't want to remove those as this would be annoying.
|
// because we don't want to remove those as this would be annoying.
|
||||||
*/
|
|
||||||
if (*comment_flags == ':' || *comment_flags == NUL) {
|
if (*comment_flags == ':' || *comment_flags == NUL) {
|
||||||
line += lead_len;
|
line += lead_len;
|
||||||
}
|
}
|
||||||
@@ -4054,8 +4053,8 @@ int do_join(size_t count, int insert_space, int save_undo, int use_formatoptions
|
|||||||
curwin->w_buffer->b_op_end.col = sumsize;
|
curwin->w_buffer->b_op_end.col = sumsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only report the change in the first line here, del_lines() will report
|
// Only report the change in the first line here, del_lines() will report
|
||||||
* the deleted line. */
|
// the deleted line.
|
||||||
changed_lines(curwin->w_cursor.lnum, currsize,
|
changed_lines(curwin->w_cursor.lnum, currsize,
|
||||||
curwin->w_cursor.lnum + 1, 0L, true);
|
curwin->w_cursor.lnum + 1, 0L, true);
|
||||||
|
|
||||||
@@ -4172,8 +4171,8 @@ void op_format(oparg_T *oap, int keep_cursor)
|
|||||||
{
|
{
|
||||||
long old_line_count = curbuf->b_ml.ml_line_count;
|
long old_line_count = curbuf->b_ml.ml_line_count;
|
||||||
|
|
||||||
/* Place the cursor where the "gq" or "gw" command was given, so that "u"
|
// Place the cursor where the "gq" or "gw" command was given, so that "u"
|
||||||
* can put it back there. */
|
// can put it back there.
|
||||||
curwin->w_cursor = oap->cursor_start;
|
curwin->w_cursor = oap->cursor_start;
|
||||||
|
|
||||||
if (u_save((linenr_T)(oap->start.lnum - 1),
|
if (u_save((linenr_T)(oap->start.lnum - 1),
|
||||||
@@ -4190,8 +4189,8 @@ void op_format(oparg_T *oap, int keep_cursor)
|
|||||||
// Set '[ mark at the start of the formatted area
|
// Set '[ mark at the start of the formatted area
|
||||||
curbuf->b_op_start = oap->start;
|
curbuf->b_op_start = oap->start;
|
||||||
|
|
||||||
/* For "gw" remember the cursor position and put it back below (adjusted
|
// For "gw" remember the cursor position and put it back below (adjusted
|
||||||
* for joined and split lines). */
|
// for joined and split lines).
|
||||||
if (keep_cursor) {
|
if (keep_cursor) {
|
||||||
saved_cursor = oap->cursor_start;
|
saved_cursor = oap->cursor_start;
|
||||||
}
|
}
|
||||||
@@ -4221,8 +4220,8 @@ void op_format(oparg_T *oap, int keep_cursor)
|
|||||||
if (oap->is_VIsual) {
|
if (oap->is_VIsual) {
|
||||||
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
||||||
if (wp->w_old_cursor_lnum != 0) {
|
if (wp->w_old_cursor_lnum != 0) {
|
||||||
/* When lines have been inserted or deleted, adjust the end of
|
// When lines have been inserted or deleted, adjust the end of
|
||||||
* the Visual area to be redrawn. */
|
// the Visual area to be redrawn.
|
||||||
if (wp->w_old_cursor_lnum > wp->w_old_visual_lnum) {
|
if (wp->w_old_cursor_lnum > wp->w_old_visual_lnum) {
|
||||||
wp->w_old_cursor_lnum += old_line_count;
|
wp->w_old_cursor_lnum += old_line_count;
|
||||||
} else {
|
} else {
|
||||||
@@ -4244,9 +4243,9 @@ void op_formatexpr(oparg_T *oap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fex_format(oap->start.lnum, oap->line_count, NUL) != 0) {
|
if (fex_format(oap->start.lnum, oap->line_count, NUL) != 0) {
|
||||||
/* As documented: when 'formatexpr' returns non-zero fall back to
|
// As documented: when 'formatexpr' returns non-zero fall back to
|
||||||
* internal formatting. */
|
// internal formatting.
|
||||||
op_format(oap, FALSE);
|
op_format(oap, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4424,8 +4423,8 @@ void format_lines(linenr_T line_count, int avoid_fex)
|
|||||||
*/
|
*/
|
||||||
if (is_end_par || force_format) {
|
if (is_end_par || force_format) {
|
||||||
if (need_set_indent) {
|
if (need_set_indent) {
|
||||||
/* replace indent in first line with minimal number of
|
// replace indent in first line with minimal number of
|
||||||
* tabs and spaces, according to current options */
|
// tabs and spaces, according to current options
|
||||||
(void)set_indent(get_indent(), SIN_CHANGED);
|
(void)set_indent(get_indent(), SIN_CHANGED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4451,8 +4450,8 @@ void format_lines(linenr_T line_count, int avoid_fex)
|
|||||||
// at end of par.: need to set indent of next par.
|
// at end of par.: need to set indent of next par.
|
||||||
need_set_indent = is_end_par;
|
need_set_indent = is_end_par;
|
||||||
if (is_end_par) {
|
if (is_end_par) {
|
||||||
/* When called with a negative line count, break at the
|
// When called with a negative line count, break at the
|
||||||
* end of the paragraph. */
|
// end of the paragraph.
|
||||||
if (line_count < 0) {
|
if (line_count < 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -4674,9 +4673,9 @@ static void block_prep(oparg_T *oap, struct block_def *bdp, linenr_T lnum, bool
|
|||||||
} else {
|
} else {
|
||||||
bdp->startspaces = oap->end_vcol - oap->start_vcol + 1;
|
bdp->startspaces = oap->end_vcol - oap->start_vcol + 1;
|
||||||
if (is_del && oap->op_type != OP_LSHIFT) {
|
if (is_del && oap->op_type != OP_LSHIFT) {
|
||||||
/* just putting the sum of those two into
|
// just putting the sum of those two into
|
||||||
* bdp->startspaces doesn't work for Visual replace,
|
// bdp->startspaces doesn't work for Visual replace,
|
||||||
* so we have to split the tab in two */
|
// so we have to split the tab in two
|
||||||
bdp->startspaces = bdp->start_char_vcols
|
bdp->startspaces = bdp->start_char_vcols
|
||||||
- (bdp->start_vcol - oap->start_vcol);
|
- (bdp->start_vcol - oap->start_vcol);
|
||||||
bdp->endspaces = bdp->end_vcol - oap->end_vcol - 1;
|
bdp->endspaces = bdp->end_vcol - oap->end_vcol - 1;
|
||||||
|
@@ -615,8 +615,8 @@ static void set_option_default(int opt_idx, int opt_flags)
|
|||||||
uint32_t flags = options[opt_idx].flags;
|
uint32_t flags = options[opt_idx].flags;
|
||||||
if (varp != NULL) { // skip hidden option, nothing to do for it
|
if (varp != NULL) { // skip hidden option, nothing to do for it
|
||||||
if (flags & P_STRING) {
|
if (flags & P_STRING) {
|
||||||
/* Use set_string_option_direct() for local options to handle
|
// Use set_string_option_direct() for local options to handle
|
||||||
* freeing and allocating the value. */
|
// freeing and allocating the value.
|
||||||
if (options[opt_idx].indir != PV_NONE) {
|
if (options[opt_idx].indir != PV_NONE) {
|
||||||
set_string_option_direct(NULL, opt_idx,
|
set_string_option_direct(NULL, opt_idx,
|
||||||
options[opt_idx].def_val, opt_flags, 0);
|
options[opt_idx].def_val, opt_flags, 0);
|
||||||
@@ -1094,8 +1094,8 @@ int do_set(char_u *arg, int opt_flags)
|
|||||||
flags = P_STRING;
|
flags = P_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip all options that are not window-local (used when showing
|
// Skip all options that are not window-local (used when showing
|
||||||
* an already loaded buffer in a window). */
|
// an already loaded buffer in a window).
|
||||||
if ((opt_flags & OPT_WINONLY)
|
if ((opt_flags & OPT_WINONLY)
|
||||||
&& (opt_idx < 0 || options[opt_idx].var != VAR_WIN)) {
|
&& (opt_idx < 0 || options[opt_idx].var != VAR_WIN)) {
|
||||||
goto skip;
|
goto skip;
|
||||||
@@ -1514,8 +1514,8 @@ int do_set(char_u *arg, int opt_flags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* concatenate the two strings; add a ',' if
|
// concatenate the two strings; add a ',' if
|
||||||
* needed */
|
// needed
|
||||||
if (adding || prepending) {
|
if (adding || prepending) {
|
||||||
comma = ((flags & P_COMMA) && *origval != NUL
|
comma = ((flags & P_COMMA) && *origval != NUL
|
||||||
&& *newval != NUL);
|
&& *newval != NUL);
|
||||||
@@ -1540,8 +1540,8 @@ int do_set(char_u *arg, int opt_flags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove newval[] from origval[]. (Note: "i" has
|
// Remove newval[] from origval[]. (Note: "i" has
|
||||||
* been set above and is used here). */
|
// been set above and is used here).
|
||||||
if (removing) {
|
if (removing) {
|
||||||
STRCPY(newval, origval);
|
STRCPY(newval, origval);
|
||||||
if (*s) {
|
if (*s) {
|
||||||
@@ -4044,8 +4044,8 @@ static char *set_bool_option(const int opt_idx, char_u *const varp, const int va
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Arabic requires a utf-8 encoding, inform the user if its not
|
// Arabic requires a utf-8 encoding, inform the user if its not
|
||||||
* set. */
|
// set.
|
||||||
if (STRCMP(p_enc, "utf-8") != 0) {
|
if (STRCMP(p_enc, "utf-8") != 0) {
|
||||||
static char *w_arabic = N_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'");
|
static char *w_arabic = N_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'");
|
||||||
|
|
||||||
@@ -4070,12 +4070,12 @@ static char *set_bool_option(const int opt_idx, char_u *const varp, const int va
|
|||||||
changed_window_setting();
|
changed_window_setting();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 'arabicshape' isn't reset, it is a global option and
|
// 'arabicshape' isn't reset, it is a global option and
|
||||||
* another window may still need it "on". */
|
// another window may still need it "on".
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 'delcombine' isn't reset, it is a global option and another
|
// 'delcombine' isn't reset, it is a global option and another
|
||||||
* window may still want it "on". */
|
// window may still want it "on".
|
||||||
|
|
||||||
// Revert to the default keymap
|
// Revert to the default keymap
|
||||||
curbuf->b_p_iminsert = B_IMODE_NONE;
|
curbuf->b_p_iminsert = B_IMODE_NONE;
|
||||||
@@ -5218,8 +5218,8 @@ int makeset(FILE *fd, int opt_flags, int local_only)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do not store options like 'bufhidden' and 'syntax' in a vimrc
|
// Do not store options like 'bufhidden' and 'syntax' in a vimrc
|
||||||
* file, they are always buffer-specific. */
|
// file, they are always buffer-specific.
|
||||||
if ((opt_flags & OPT_GLOBAL) && (p->flags & P_NOGLOB)) {
|
if ((opt_flags & OPT_GLOBAL) && (p->flags & P_NOGLOB)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -5339,9 +5339,9 @@ static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep, uint6
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (*valuep != NULL) {
|
if (*valuep != NULL) {
|
||||||
/* Output 'pastetoggle' as key names. For other
|
// Output 'pastetoggle' as key names. For other
|
||||||
* options some characters have to be escaped with
|
// options some characters have to be escaped with
|
||||||
* CTRL-V or backslash */
|
// CTRL-V or backslash
|
||||||
if (valuep == &p_pt) {
|
if (valuep == &p_pt) {
|
||||||
s = *valuep;
|
s = *valuep;
|
||||||
while (*s != NUL) {
|
while (*s != NUL) {
|
||||||
@@ -6607,8 +6607,8 @@ void ExpandOldSetting(int *num_file, char_u ***file)
|
|||||||
char_u *buf = vim_strsave_escaped(var, escape_chars);
|
char_u *buf = vim_strsave_escaped(var, escape_chars);
|
||||||
|
|
||||||
#ifdef BACKSLASH_IN_FILENAME
|
#ifdef BACKSLASH_IN_FILENAME
|
||||||
/* For MS-Windows et al. we don't double backslashes at the start and
|
// For MS-Windows et al. we don't double backslashes at the start and
|
||||||
* before a file name character. */
|
// before a file name character.
|
||||||
for (var = buf; *var != NUL; MB_PTR_ADV(var)) {
|
for (var = buf; *var != NUL; MB_PTR_ADV(var)) {
|
||||||
if (var[0] == '\\' && var[1] == '\\'
|
if (var[0] == '\\' && var[1] == '\\'
|
||||||
&& expand_option_idx >= 0
|
&& expand_option_idx >= 0
|
||||||
|
Reference in New Issue
Block a user