aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Morales <hel.sheep@gmail.com>2014-11-21 12:44:13 -0300
committerFelipe Morales <hel.sheep@gmail.com>2014-11-27 19:40:51 -0300
commitcfa8b4a1863fc59a6cd15022b5a69f36af65ddc9 (patch)
tree93fc8fb6dd91c2886cc6188e8571d8e7536b12d8
parentef7eab1ec6b40afe2c88d78aaeeda65980ff6b2f (diff)
downloadrneovim-cfa8b4a1863fc59a6cd15022b5a69f36af65ddc9.tar.gz
rneovim-cfa8b4a1863fc59a6cd15022b5a69f36af65ddc9.tar.bz2
rneovim-cfa8b4a1863fc59a6cd15022b5a69f36af65ddc9.zip
vim-patch:7.4.435: Disable linebreak temporarily when formatting lines.
vim-patch:7.4.435 Problem: Line formatting behaves differently when 'linebreak' is set. (mvxxc) Solution: Disable 'linebreak' temporarily. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-435
-rw-r--r--src/nvim/edit.c6
-rw-r--r--src/nvim/version.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index d7910347fc..8bf5170ae7 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -5074,6 +5074,10 @@ internal_format (
colnr_T leader_len;
int no_leader = FALSE;
int do_comments = (flags & INSCHAR_DO_COM);
+ int has_lbr = curwin->w_p_lbr;
+
+ // make sure win_lbr_chartabsize() counts correctly
+ curwin->w_p_lbr = false;
/*
* When 'ai' is off we don't want a space under the cursor to be
@@ -5363,6 +5367,8 @@ internal_format (
if (save_char != NUL) /* put back space after cursor */
pchar_cursor(save_char);
+ curwin->w_p_lbr = has_lbr;
+
if (!format_only && haveto_redraw) {
update_topline();
redraw_curbuf_later(VALID);
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 34a14ef398..c692e43625 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -230,7 +230,7 @@ static int included_patches[] = {
//438,
437,
436,
- //435,
+ 435,
//434,
433,
//432 NA