From cfa8b4a1863fc59a6cd15022b5a69f36af65ddc9 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Fri, 21 Nov 2014 12:44:13 -0300 Subject: [PATCH] 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 --- src/nvim/edit.c | 6 ++++++ src/nvim/version.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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