summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-04-21 17:22:33 +0200
committerBram Moolenaar <Bram@vim.org>2019-04-21 17:22:33 +0200
commit958eabe5e53673fc39186432ff98b3656663beeb (patch)
tree4c95bff9bdb23e3bb02c47aa95d70dd1fb756f06
parentc75e81262347e47a69faabd72caf89fec3f06e8f (diff)
downloadvim-git-958eabe5e53673fc39186432ff98b3656663beeb.tar.gz
patch 8.1.1198: bracketed paste may remain active after Vim existsv8.1.1198
Problem: Bracketed paste may remain active after Vim exists, because the terminal emulater restores the setting. Solution: Set/reset bracketed paste mode before setting the terminal mode. (closes #3579)
-rw-r--r--src/term.c18
-rw-r--r--src/version.c2
2 files changed, 13 insertions, 7 deletions
diff --git a/src/term.c b/src/term.c
index c7e8ddf0c..5bae1f2dd 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3496,19 +3496,23 @@ settmode(int tmode)
#endif
#ifdef FEAT_MOUSE_TTY
if (tmode != TMODE_RAW)
- mch_setmouse(FALSE); /* switch mouse off */
+ mch_setmouse(FALSE); // switch mouse off
#endif
- if (tmode != TMODE_RAW)
- out_str(T_BD); /* disable bracketed paste mode */
+ if (termcap_active)
+ {
+ if (tmode != TMODE_RAW)
+ out_str(T_BD); // disable bracketed paste mode
+ else
+ out_str(T_BE); // enable bracketed paste mode (should
+ // be before mch_settmode().
+ }
out_flush();
- mch_settmode(tmode); /* machine specific function */
+ mch_settmode(tmode); // machine specific function
cur_tmode = tmode;
#ifdef FEAT_MOUSE
if (tmode == TMODE_RAW)
- setmouse(); /* may switch mouse on */
+ setmouse(); // may switch mouse on
#endif
- if (tmode == TMODE_RAW)
- out_str(T_BE); /* enable bracketed paste mode */
out_flush();
}
#ifdef FEAT_TERMRESPONSE
diff --git a/src/version.c b/src/version.c
index 234f4bf04..48e8d99e8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1198,
+/**/
1197,
/**/
1196,