Merge pull request #1728 from fwalch/small-patches2

vim-patch: Multiple small patches (2)
This commit is contained in:
Justin M. Keyes
2014-12-23 15:19:07 -05:00
7 changed files with 25 additions and 12 deletions

View File

@@ -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) { if (col >= (colnr_T)wp->w_width) {
col -= wp->w_width; col -= wp->w_width;
numberextra = wp->w_width - (numberextra - win_col_off2(wp)); numberextra = wp->w_width - (numberextra - win_col_off2(wp));
if (numberextra > 0) {
col %= numberextra;
}
if (*p_sbr != NUL) { if (*p_sbr != NUL) {
colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr); colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr);
if (col >= sbrlen) if (col >= sbrlen)

View File

@@ -2237,7 +2237,7 @@ void ex_diffgetput(exarg_T *eap)
} }
} }
buf_empty = FALSE; buf_empty = bufempty();
added = 0; added = 0;
for (i = 0; i < count; ++i) { for (i = 0; i < count; ++i) {

View File

@@ -15278,7 +15278,7 @@ static void f_winrestview(typval_T *argvars, typval_T *rettv)
win_new_width(curwin, curwin->w_width); win_new_width(curwin, curwin->w_width);
changed_window_setting(); changed_window_setting();
if (curwin->w_topline == 0) if (curwin->w_topline <= 0)
curwin->w_topline = 1; curwin->w_topline = 1;
if (curwin->w_topline > curbuf->b_ml.ml_line_count) if (curwin->w_topline > curbuf->b_ml.ml_line_count)
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; regmatch_T regmatch;
int do_all; int do_all;
char_u *tail; char_u *tail;
char_u *end;
garray_T ga; garray_T ga;
char_u *save_cpo; char_u *save_cpo;
char_u *zero_width = NULL; 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); regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
if (regmatch.regprog != NULL) { if (regmatch.regprog != NULL) {
tail = str; tail = str;
end = str + STRLEN(str);
while (vim_regexec_nl(&regmatch, str, (colnr_T)(tail - str))) { while (vim_regexec_nl(&regmatch, str, (colnr_T)(tail - str))) {
/* Skip empty match except for first match. */ /* Skip empty match except for first match. */
if (regmatch.startp[0] == regmatch.endp[0]) { 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. * - The text after the match.
*/ */
sublen = vim_regsub(&regmatch, sub, tail, FALSE, TRUE, FALSE); 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]))); (regmatch.endp[0] - regmatch.startp[0])));
/* copy the text up to where the match is */ /* copy the text up to where the match is */

View File

@@ -70,6 +70,7 @@
#include "nvim/os/input.h" #include "nvim/os/input.h"
#include "nvim/os/time.h" #include "nvim/os/time.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/mouse.h"
static int quitmore = 0; static int quitmore = 0;
static int ex_pressedreturn = FALSE; 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 */ msg_didout |= save_msg_didout; /* don't reset msg_didout now */
/* Restore the state (needed when called from a function executed for /* 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; State = save_State;
setmouse();
ui_cursor_shape(); /* may show different cursor shape */
free(arg); free(arg);
} }

View File

@@ -3583,6 +3583,12 @@ restore_backup:
&& (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL) && (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL)
) { ) {
unchanged(buf, TRUE); 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_unchanged(buf);
u_update_save_nr(buf); u_update_save_nr(buf);
} }

View File

@@ -3955,7 +3955,6 @@ skip_add:
#endif #endif
switch (state->c) { switch (state->c) {
case NFA_MATCH: case NFA_MATCH:
//nfa_match = TRUE;
break; break;
case NFA_SPLIT: case NFA_SPLIT:

View File

@@ -239,17 +239,17 @@ static int included_patches[] = {
//502, //502,
//501 NA //501 NA
//500, //500,
//499, 499,
//498 NA //498 NA
//497, //497,
//496 NA //496 NA
//495 NA //495 NA
//494, 494,
//493, 493,
//492, //492,
//491, 491,
//490, //490,
//489, 489,
//488, //488,
//487, //487,
//486, //486,
@@ -261,10 +261,10 @@ static int included_patches[] = {
//480 NA //480 NA
//479 NA //479 NA
478, 478,
//477, 477,
//476 NA //476 NA
//475 NA //475 NA
//474, 474,
473, 473,
472, 472,
//471 NA //471 NA