aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/change.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r--src/nvim/change.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c
index b15e90e0bc..94e5a19edc 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -209,6 +209,10 @@ static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra
curwin->w_changelistidx = curbuf->b_changelistlen;
}
+ if (VIsual_active) {
+ check_visual_pos();
+ }
+
FOR_ALL_TAB_WINDOWS(tp, wp) {
if (wp->w_buffer == curbuf) {
// Mark this window to be redrawn later.
@@ -963,8 +967,7 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
char_u *p;
char_u saved_char = NUL; // init for GCC
pos_T *pos;
- bool do_si = (!p_paste && curbuf->b_p_si && !curbuf->b_p_cin
- && *curbuf->b_p_inde == NUL);
+ bool do_si = may_do_si();
bool do_cindent;
bool no_si = false; // reset did_si afterwards
int first_char = NUL; // init for GCC
@@ -1499,7 +1502,7 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
while (off > 0 && lead_len > 0
&& leader[lead_len - 1] == ' ') {
// Don't do it when there is a tab before the space
- if (vim_strchr((char_u *)skipwhite((char *)leader), '\t') != NULL) {
+ if (vim_strchr(skipwhite((char *)leader), '\t') != NULL) {
break;
}
lead_len--;
@@ -1879,7 +1882,7 @@ int get_leader_len(char_u *line, char_u **flags, bool backward, bool include_spa
{
int j;
int got_com = false;
- char_u part_buf[COM_MAX_LEN]; // buffer for one option part
+ char part_buf[COM_MAX_LEN]; // buffer for one option part
char_u *string; // pointer to comment string
char_u *list;
int middle_match_len = 0;
@@ -1903,8 +1906,8 @@ int get_leader_len(char_u *line, char_u **flags, bool backward, bool include_spa
*flags = list; // remember where flags started
}
prev_list = list;
- (void)copy_option_part(&list, part_buf, COM_MAX_LEN, ",");
- string = vim_strchr(part_buf, ':');
+ (void)copy_option_part(&list, (char_u *)part_buf, COM_MAX_LEN, ",");
+ string = (char_u *)vim_strchr(part_buf, ':');
if (string == NULL) { // missing ':', ignore this part
continue;
}
@@ -2026,7 +2029,7 @@ int get_last_leader_offset(char_u *line, char_u **flags)
char_u *com_leader;
char_u *com_flags;
char_u *list;
- char_u part_buf[COM_MAX_LEN]; // buffer for one option part
+ char part_buf[COM_MAX_LEN]; // buffer for one option part
// Repeat to match several nested comment strings.
int i = (int)STRLEN(line);
@@ -2038,8 +2041,8 @@ int get_last_leader_offset(char_u *line, char_u **flags)
// Get one option part into part_buf[]. Advance list to next one.
// put string at start of string.
- (void)copy_option_part(&list, part_buf, COM_MAX_LEN, ",");
- string = vim_strchr(part_buf, ':');
+ (void)copy_option_part(&list, (char_u *)part_buf, COM_MAX_LEN, ",");
+ string = (char_u *)vim_strchr(part_buf, ':');
if (string == NULL) { // If everything is fine, this cannot actually
// happen.
continue;
@@ -2097,7 +2100,7 @@ int get_last_leader_offset(char_u *line, char_u **flags)
}
if (found_one) {
- char_u part_buf2[COM_MAX_LEN]; // buffer for one option part
+ char part_buf2[COM_MAX_LEN]; // buffer for one option part
int len1, len2, off;
result = i;
@@ -2121,11 +2124,11 @@ int get_last_leader_offset(char_u *line, char_u **flags)
for (list = curbuf->b_p_com; *list;) {
char_u *flags_save = list;
- (void)copy_option_part(&list, part_buf2, COM_MAX_LEN, ",");
+ (void)copy_option_part(&list, (char_u *)part_buf2, COM_MAX_LEN, ",");
if (flags_save == com_flags) {
continue;
}
- string = vim_strchr(part_buf2, ':');
+ string = (char_u *)vim_strchr(part_buf2, ':');
string++;
while (ascii_iswhite(*string)) {
string++;