aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-12-23 15:19:07 -0500
committerJustin M. Keyes <justinkz@gmail.com>2014-12-23 15:19:07 -0500
commitaa08632caf80d2259d94e8f6e30cd806e3c05a1d (patch)
treefac1e6456a15da2a08a857fdc3c5e2d7fc645af6
parent4f6bb8a9a997aacbe9f9f1ca83e7e4c502bdc03c (diff)
parentfc0be5b79dfccc582005367da5ee24bd73592879 (diff)
downloadrneovim-aa08632caf80d2259d94e8f6e30cd806e3c05a1d.tar.gz
rneovim-aa08632caf80d2259d94e8f6e30cd806e3c05a1d.tar.bz2
rneovim-aa08632caf80d2259d94e8f6e30cd806e3c05a1d.zip
Merge pull request #1728 from fwalch/small-patches2
vim-patch: Multiple small patches (2)
-rw-r--r--src/nvim/charset.c3
-rw-r--r--src/nvim/diff.c2
-rw-r--r--src/nvim/eval.c6
-rw-r--r--src/nvim/ex_docmd.c5
-rw-r--r--src/nvim/fileio.c6
-rw-r--r--src/nvim/regexp_nfa.c1
-rw-r--r--src/nvim/version.c14
7 files changed, 25 insertions, 12 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index 9e5194a5df..32427cc3ba 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -1058,6 +1058,9 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he
if (col >= (colnr_T)wp->w_width) {
col -= wp->w_width;
numberextra = wp->w_width - (numberextra - win_col_off2(wp));
+ if (numberextra > 0) {
+ col %= numberextra;
+ }
if (*p_sbr != NUL) {
colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr);
if (col >= sbrlen)
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 3151daf826..7e31c3f216 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -2237,7 +2237,7 @@ void ex_diffgetput(exarg_T *eap)
}
}
- buf_empty = FALSE;
+ buf_empty = bufempty();
added = 0;
for (i = 0; i < count; ++i) {
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index f50a215559..67a68f70d5 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -15278,7 +15278,7 @@ static void f_winrestview(typval_T *argvars, typval_T *rettv)
win_new_width(curwin, curwin->w_width);
changed_window_setting();
- if (curwin->w_topline == 0)
+ if (curwin->w_topline <= 0)
curwin->w_topline = 1;
if (curwin->w_topline > curbuf->b_ml.ml_line_count)
curwin->w_topline = curbuf->b_ml.ml_line_count;
@@ -19665,6 +19665,7 @@ char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, char_u *flags)
regmatch_T regmatch;
int do_all;
char_u *tail;
+ char_u *end;
garray_T ga;
char_u *save_cpo;
char_u *zero_width = NULL;
@@ -19681,6 +19682,7 @@ char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, char_u *flags)
regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
if (regmatch.regprog != NULL) {
tail = str;
+ end = str + STRLEN(str);
while (vim_regexec_nl(&regmatch, str, (colnr_T)(tail - str))) {
/* Skip empty match except for first match. */
if (regmatch.startp[0] == regmatch.endp[0]) {
@@ -19703,7 +19705,7 @@ char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, char_u *flags)
* - The text after the match.
*/
sublen = vim_regsub(&regmatch, sub, tail, FALSE, TRUE, FALSE);
- ga_grow(&ga, (int)(STRLEN(tail) + sublen -
+ ga_grow(&ga, (int)((end - tail) + sublen -
(regmatch.endp[0] - regmatch.startp[0])));
/* copy the text up to where the match is */
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index f25af3f587..e4a8c2735b 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -70,6 +70,7 @@
#include "nvim/os/input.h"
#include "nvim/os/time.h"
#include "nvim/ex_cmds_defs.h"
+#include "nvim/mouse.h"
static int quitmore = 0;
static int ex_pressedreturn = FALSE;
@@ -7222,8 +7223,10 @@ static void ex_normal(exarg_T *eap)
msg_didout |= save_msg_didout; /* don't reset msg_didout now */
/* Restore the state (needed when called from a function executed for
- * 'indentexpr'). */
+ * 'indentexpr'). Update the mouse and cursor, they may have changed. */
State = save_State;
+ setmouse();
+ ui_cursor_shape(); /* may show different cursor shape */
free(arg);
}
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 82613f5b07..58e67fa58c 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -3583,6 +3583,12 @@ restore_backup:
&& (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL)
) {
unchanged(buf, TRUE);
+ /* buf->b_changedtick is always incremented in unchanged() but that
+ * should not trigger a TextChanged event. */
+ if (last_changedtick + 1 == buf->b_changedtick
+ && last_changedtick_buf == buf) {
+ last_changedtick = buf->b_changedtick;
+ }
u_unchanged(buf);
u_update_save_nr(buf);
}
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index 60cdc12c92..2bf73ce72b 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -3955,7 +3955,6 @@ skip_add:
#endif
switch (state->c) {
case NFA_MATCH:
- //nfa_match = TRUE;
break;
case NFA_SPLIT:
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 2b099fba11..91f160d83f 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -239,17 +239,17 @@ static int included_patches[] = {
//502,
//501 NA
//500,
- //499,
+ 499,
//498 NA
//497,
//496 NA
//495 NA
- //494,
- //493,
+ 494,
+ 493,
//492,
- //491,
+ 491,
//490,
- //489,
+ 489,
//488,
//487,
//486,
@@ -261,10 +261,10 @@ static int included_patches[] = {
//480 NA
//479 NA
478,
- //477,
+ 477,
//476 NA
//475 NA
- //474,
+ 474,
473,
472,
//471 NA