aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c48
1 files changed, 11 insertions, 37 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index b9ecbc71fe..c7f20783a9 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -56,9 +56,12 @@
#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/input.h"
+#include "nvim/os/time.h"
/*
* definitions used for CTRL-X submode
@@ -388,9 +391,6 @@ edit (
*/
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
State |= LANGMAP;
-#ifdef USE_IM_CONTROL
- im_set_active(curbuf->b_p_iminsert == B_IMODE_IM);
-#endif
setmouse();
clear_showcmd();
@@ -1761,7 +1761,7 @@ static int has_compl_option(int dict_opt)
vim_beep();
setcursor();
out_flush();
- ui_delay(2000L, false);
+ os_delay(2000L, false);
}
return FALSE;
}
@@ -2005,7 +2005,7 @@ ins_compl_add (
compl_T *match;
int dir = (cdir == 0 ? compl_direction : cdir);
- ui_breakcheck();
+ os_breakcheck();
if (got_int)
return FAIL;
if (len < 0)
@@ -5078,6 +5078,10 @@ internal_format (
colnr_T leader_len;
int no_leader = FALSE;
int do_comments = (flags & INSCHAR_DO_COM);
+ int has_lbr = curwin->w_p_lbr;
+
+ // make sure win_lbr_chartabsize() counts correctly
+ curwin->w_p_lbr = false;
/*
* When 'ai' is off we don't want a space under the cursor to be
@@ -5367,6 +5371,8 @@ internal_format (
if (save_char != NUL) /* put back space after cursor */
pchar_cursor(save_char);
+ curwin->w_p_lbr = has_lbr;
+
if (!format_only && haveto_redraw) {
update_topline();
redraw_curbuf_later(VALID);
@@ -6755,19 +6761,11 @@ static void ins_reg(void)
* message for it. Only call it explicitly. */
++no_u_sync;
if (regname == '=') {
-# ifdef USE_IM_CONTROL
- int im_on = im_get_status();
-# endif
/* Sync undo when evaluating the expression calls setline() or
* append(), so that it can be undone separately. */
u_sync_once = 2;
regname = get_expr_register();
-# ifdef USE_IM_CONTROL
- /* Restore the Input Method. */
- if (im_on)
- im_set_active(TRUE);
-# endif
}
if (regname == NUL || !valid_yank_reg(regname, FALSE)) {
vim_beep();
@@ -6864,24 +6862,8 @@ static void ins_ctrl_hat(void)
} else {
curbuf->b_p_iminsert = B_IMODE_LMAP;
State |= LANGMAP;
-#ifdef USE_IM_CONTROL
- im_set_active(FALSE);
-#endif
- }
- }
-#ifdef USE_IM_CONTROL
- else {
- /* There are no ":lmap" mappings, toggle IM */
- if (im_get_status()) {
- curbuf->b_p_iminsert = B_IMODE_NONE;
- im_set_active(FALSE);
- } else {
- curbuf->b_p_iminsert = B_IMODE_IM;
- State &= ~LANGMAP;
- im_set_active(TRUE);
}
}
-#endif
set_iminsert_global();
showmode();
/* Show/unshow value of 'keymap' in status lines. */
@@ -6981,14 +6963,6 @@ ins_esc (
}
}
-#ifdef USE_IM_CONTROL
- /* Disable IM to allow typing English directly for Normal mode commands.
- * When ":lmap" is enabled don't change 'iminsert' (IM can be enabled as
- * well). */
- if (!(State & LANGMAP))
- im_save_status(&curbuf->b_p_iminsert);
- im_set_active(FALSE);
-#endif
State = NORMAL;
/* need to position cursor again (e.g. when on a TAB ) */