aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index e74fcef8d9..e7079e02d0 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -11,6 +11,7 @@
* op_change, op_yank, do_put, do_join
*/
+#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <string.h>
@@ -3436,7 +3437,7 @@ int do_join(long count,
&& has_format_option(FO_REMOVE_COMS);
int prev_was_comment;
-
+ assert(count > 1);
if (save_undo && u_save((linenr_T)(curwin->w_cursor.lnum - 1),
(linenr_T)(curwin->w_cursor.lnum + count)) == FAIL)
return FAIL;
@@ -5027,6 +5028,8 @@ void cursor_pos_info(void)
pos_T min_pos, max_pos;
oparg_T oparg;
struct block_def bd;
+ const int l_VIsual_active = VIsual_active;
+ const int l_VIsual_mode = VIsual_mode;
/*
* Compute the length of the file in characters.
@@ -5039,7 +5042,7 @@ void cursor_pos_info(void)
else
eol_size = 1;
- if (VIsual_active) {
+ if (l_VIsual_active) {
if (lt(VIsual, curwin->w_cursor)) {
min_pos = VIsual;
max_pos = curwin->w_cursor;
@@ -5050,7 +5053,7 @@ void cursor_pos_info(void)
if (*p_sel == 'e' && max_pos.col > 0)
--max_pos.col;
- if (VIsual_mode == Ctrl_V) {
+ if (l_VIsual_mode == Ctrl_V) {
char_u * saved_sbr = p_sbr;
/* Make 'sbr' empty for a moment to get the correct size. */
@@ -5083,12 +5086,12 @@ void cursor_pos_info(void)
}
/* Do extra processing for VIsual mode. */
- if (VIsual_active
+ if (l_VIsual_active
&& lnum >= min_pos.lnum && lnum <= max_pos.lnum) {
char_u *s = NULL;
long len = 0L;
- switch (VIsual_mode) {
+ switch (l_VIsual_mode) {
case Ctrl_V:
virtual_op = virtual_active();
block_prep(&oparg, &bd, lnum, 0);
@@ -5141,8 +5144,8 @@ void cursor_pos_info(void)
if (!curbuf->b_p_eol && curbuf->b_p_bin)
byte_count -= eol_size;
- if (VIsual_active) {
- if (VIsual_mode == Ctrl_V && curwin->w_curswant < MAXCOL) {
+ if (l_VIsual_active) {
+ if (l_VIsual_mode == Ctrl_V && curwin->w_curswant < MAXCOL) {
getvcols(curwin, &min_pos, &max_pos, &min_pos.col,
&max_pos.col);
vim_snprintf((char *)buf1, sizeof(buf1), _("%" PRId64 " Cols; "),