aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroni-link <knil.ino@gmail.com>2014-04-13 01:18:45 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-14 16:57:44 -0300
commit71e1cccc7a69feb3a1c1bf5c3b6a3ae464ae17fb (patch)
tree1fe2fd79b813cfa1e1f812e5789f767aee1df533
parent78fd9386b6c9fd5d335a95ee1d7c71395a4b903a (diff)
downloadrneovim-71e1cccc7a69feb3a1c1bf5c3b6a3ae464ae17fb.tar.gz
rneovim-71e1cccc7a69feb3a1c1bf5c3b6a3ae464ae17fb.tar.bz2
rneovim-71e1cccc7a69feb3a1c1bf5c3b6a3ae464ae17fb.zip
vim-patch:7.4.207
Problem: The cursor report sequence is sometimes not recognized and results in entering replace mode. Solution: Also check for the cursor report when not asked for. https://code.google.com/p/vim/source/detail?r=2aa909427e44cd3aac7def024b66e41d0c9d0e0d
-rw-r--r--src/term.c31
-rw-r--r--src/version.c2
2 files changed, 23 insertions, 10 deletions
diff --git a/src/term.c b/src/term.c
index 0cf3da9740..6a9d39b54d 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2757,7 +2757,8 @@ void may_req_ambiguous_char_width(void)
out_str(buf);
out_str(T_U7);
u7_status = U7_SENT;
- term_windgoto(0, 0);
+ out_flush();
+ term_windgoto(1, 0);
out_str((char_u *)" ");
term_windgoto(0, 0);
/* check for the characters now, otherwise they might be eaten by
@@ -3423,33 +3424,43 @@ int check_termcode(int max_offset, char_u *buf, int bufsize, int *buflen)
&& ((tp[0] == ESC && tp[1] == '[' && len >= 3)
|| (tp[0] == CSI && len >= 2))
&& (VIM_ISDIGIT(*p) || *p == '>' || *p == '?')) {
+ int col;
+ int row_char;
j = 0;
extra = 0;
for (i = 2 + (tp[0] != CSI); i < len
&& !(tp[i] >= '{' && tp[i] <= '~')
&& !ASCII_ISALPHA(tp[i]); ++i)
- if (tp[i] == ';' && ++j == 1)
+ if (tp[i] == ';' && ++j == 1) {
extra = i + 1;
+ row_char = tp[i - 1];
+ }
if (i == len) {
LOG_TR("Not enough characters for CRV");
return -1;
}
+ if (extra > 0) {
+ col = atoi((char *)tp + extra);
+ } else {
+ col = 0;
+ }
- /* Eat it when it has 2 arguments and ends in 'R'. Ignore it
- * when u7_status is not "sent", <S-F3> sends something
- * similar. */
- if (j == 1 && tp[i] == 'R' && u7_status == U7_SENT) {
+ /* Eat it when it has 2 arguments and ends in 'R'. Also when
+ * u7_status is not "sent", it may be from a previous Vim that
+ * just exited. But not for <S-F3>, it sends something
+ * similar, check for row and column to make sense. */
+ if (j == 1 && tp[i] == 'R' && row_char == '2' && col >= 2) {
char *aw = NULL;
LOG_TR("Received U7 status");
u7_status = U7_GOT;
did_cursorhold = TRUE;
- if (extra > 0)
- extra = atoi((char *)tp + extra);
- if (extra == 2)
+ if (col == 2) {
aw = "single";
- else if (extra == 3)
+ } else if (col == 3) {
aw = "double";
+ }
+
if (aw != NULL && STRCMP(aw, p_ambw) != 0) {
/* Setting the option causes a screen redraw. Do that
* right away if possible, keeping any messages. */
diff --git a/src/version.c b/src/version.c
index 6e0e05bb7e..83a5ffca3c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -202,6 +202,8 @@ static char *(features[]) = {
static int included_patches[] = {
// Add new patch number below this line
+ 207,
+ //206,
205,
204,
203,