aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 107f61919a..8a56a08aaa 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1476,7 +1476,7 @@ void set_curbuf(buf_T *buf, int action)
// Do not sync when in Insert mode and the buffer is open in
// another window, might be a timer doing something in another
// window.
- if (prevbuf == curbuf && ((State & INSERT) == 0 || curbuf->b_nwindows <= 1)) {
+ if (prevbuf == curbuf && ((State & MODE_INSERT) == 0 || curbuf->b_nwindows <= 1)) {
u_sync(false);
}
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL,
@@ -3961,8 +3961,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san
break;
case STL_COLUMN:
- num = !(State & INSERT) && empty_line
- ? 0 : (int)wp->w_cursor.col + 1;
+ num = (State & MODE_INSERT) == 0 && empty_line ? 0 : (int)wp->w_cursor.col + 1;
break;
case STL_VIRTCOL:
@@ -3970,7 +3969,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san
colnr_T virtcol = wp->w_virtcol + 1;
// Don't display %V if it's the same as %c.
if (opt == STL_VIRTCOL_ALT
- && (virtcol == (colnr_T)(!(State & INSERT) && empty_line
+ && (virtcol == (colnr_T)((State & MODE_INSERT) == 0 && empty_line
? 0 : (int)wp->w_cursor.col + 1))) {
break;
}
@@ -4028,7 +4027,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san
long l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL,
false);
num = (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) || l < 0 ?
- 0L : l + 1 + (!(State & INSERT) && empty_line ?
+ 0L : l + 1 + ((State & MODE_INSERT) == 0 && empty_line ?
0 : (int)wp->w_cursor.col);
break;
}