aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Twupack <atwupack@mailbox.org>2014-09-10 21:33:51 +0200
committerAndré Twupack <atwupack@mailbox.org>2014-09-10 21:33:51 +0200
commit60371bb1bbde7377a270413d62a00ae5271b3ff7 (patch)
tree9466eaf61369e2105d5d790f0f39251931f6f59a
parent34c418fceb457bb21bf365311ce558d2d616b24a (diff)
downloadrneovim-60371bb1bbde7377a270413d62a00ae5271b3ff7.tar.gz
rneovim-60371bb1bbde7377a270413d62a00ae5271b3ff7.tar.bz2
rneovim-60371bb1bbde7377a270413d62a00ae5271b3ff7.zip
vim-patch:7.4.345
Problem: Indent is not updated when deleting indent. Solution: Remember changedtick. https://code.google.com/p/vim/source/detail?r=v7-4-345
-rw-r--r--src/nvim/indent.c6
-rw-r--r--src/nvim/version.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index 9258ee93b6..7090e007bf 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -451,6 +451,7 @@ int get_breakindent_win(win_T *wp, char_u *line) {
static int prev_indent = 0; /* cached indent value */
static int prev_ts = 0L; /* cached tabstop value */
static char_u *prev_line = NULL; /* cached pointer to line */
+ static int prev_tick = 0; // changedtick of cached value
int bri = 0;
/* window width minus window margin space, i.e. what rests for text */
const int eff_wwidth = wp->w_width
@@ -459,10 +460,11 @@ int get_breakindent_win(win_T *wp, char_u *line) {
? number_width(wp) + 1 : 0);
/* used cached indent, unless pointer or 'tabstop' changed */
- if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts)
- {
+ if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts
+ || prev_tick != wp->w_buffer->b_changedtick) {
prev_line = line;
prev_ts = wp->w_buffer->b_p_ts;
+ prev_tick = wp->w_buffer->b_changedtick;
prev_indent = get_indent_str(line,
(int)wp->w_buffer->b_p_ts, wp->w_p_list);
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 092d21f580..965becdd3d 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -250,7 +250,7 @@ static int included_patches[] = {
//348,
//347,
346,
- //345,
+ 345,
344,
343,
//342 NA