aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index f58e044c2c..0a43d59607 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -57,9 +57,11 @@
#include "nvim/tag.h"
#include "nvim/term.h"
#include "nvim/ui.h"
+#include "nvim/mouse.h"
#include "nvim/undo.h"
#include "nvim/window.h"
#include "nvim/os/event.h"
+#include "nvim/os/time.h"
/*
* The Visual area is remembered for reselection.
@@ -715,9 +717,6 @@ getcount:
bool lit = false; /* get extra character literally */
bool langmap_active = false; /* using :lmap mappings */
int lang; /* getting a text character */
-#ifdef USE_IM_CONTROL
- bool save_smd; /* saved value of p_smd */
-#endif
++no_mapping;
++allow_keys; /* no mapping for nchar, but allow key codes */
@@ -766,12 +765,6 @@ getcount:
State = LANGMAP;
langmap_active = true;
}
-#ifdef USE_IM_CONTROL
- save_smd = p_smd;
- p_smd = false; /* Don't let the IM code show the mode here */
- if (lang && curbuf->b_p_iminsert == B_IMODE_IM)
- im_set_active(true);
-#endif
*cp = plain_vgetc();
@@ -781,14 +774,6 @@ getcount:
++allow_keys;
State = NORMAL_BUSY;
}
-#ifdef USE_IM_CONTROL
- if (lang) {
- if (curbuf->b_p_iminsert != B_IMODE_LMAP)
- im_save_status(&curbuf->b_p_iminsert);
- im_set_active(false);
- }
- p_smd = save_smd;
-#endif
State = NORMAL_BUSY;
need_flushbuf |= add_to_showcmd(*cp);
@@ -1008,8 +993,8 @@ getcount:
cursor_on();
out_flush();
if (msg_scroll || emsg_on_display)
- ui_delay(1000L, true); /* wait at least one second */
- ui_delay(3000L, false); /* wait up to three seconds */
+ os_delay(1000L, true); /* wait at least one second */
+ os_delay(3000L, false); /* wait up to three seconds */
State = save_State;
msg_scroll = false;
@@ -1106,6 +1091,10 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
pos_T old_cursor;
bool empty_region_error;
int restart_edit_save;
+ int lbr_saved = curwin->w_p_lbr;
+
+ curwin->w_p_lbr = false; /* avoid a problem with unwanted linebreaks in
+ * block mode */
/* The visual area is remembered for redo */
static int redo_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
@@ -1718,6 +1707,7 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
oap->block_mode = false;
clearop(oap);
}
+ curwin->w_p_lbr = lbr_saved;
}
/*
@@ -3499,7 +3489,11 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
* screenline or move two screenlines.
*/
validate_virtcol();
- if (curwin->w_virtcol > curwin->w_curswant
+ colnr_T virtcol = curwin->w_virtcol;
+ if (virtcol > (colnr_T)width1 && *p_sbr != NUL)
+ virtcol -= vim_strsize(p_sbr);
+
+ if (virtcol > curwin->w_curswant
&& (curwin->w_curswant < (colnr_T)width1
? (curwin->w_curswant > (colnr_T)width1 / 2)
: ((curwin->w_curswant - width1) % width2