aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-12-13 00:09:07 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-12-13 00:09:07 -0500
commitaca51f3d9314c70a4df0f15bcb84edd2dc127ff0 (patch)
treeb92532b6cec03547d223de16f6219b6f9f653c9a /src/nvim/option.c
parentebdb802bf55a45eb7e4fa59cdb0689e7a3323f86 (diff)
parent98f9ff730b276fe029764ad1d657f3eba40a7068 (diff)
downloadrneovim-aca51f3d9314c70a4df0f15bcb84edd2dc127ff0.tar.gz
rneovim-aca51f3d9314c70a4df0f15bcb84edd2dc127ff0.tar.bz2
rneovim-aca51f3d9314c70a4df0f15bcb84edd2dc127ff0.zip
Merge #3443 'vim-patch:7.4.{785,795,898}'
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index dbcd230186..da74c0f288 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -122,6 +122,7 @@ static char_u *p_cpt;
static char_u *p_cfu;
static char_u *p_ofu;
static int p_eol;
+static int p_fixeol;
static int p_et;
static char_u *p_fenc;
static char_u *p_ff;
@@ -3592,6 +3593,9 @@ set_bool_option (
/* when 'endofline' is changed, redraw the window title */
else if ((int *)varp == &curbuf->b_p_eol) {
redraw_titles();
+ } else if ((int *)varp == &curbuf->b_p_fixeol) {
+ // when 'fixeol' is changed, redraw the window title
+ redraw_titles();
}
/* when 'bomb' is changed, redraw the window title and tab page text */
else if ((int *)varp == &curbuf->b_p_bomb) {
@@ -5304,6 +5308,7 @@ static char_u *get_varp(vimoption_T *p)
case PV_CFU: return (char_u *)&(curbuf->b_p_cfu);
case PV_OFU: return (char_u *)&(curbuf->b_p_ofu);
case PV_EOL: return (char_u *)&(curbuf->b_p_eol);
+ case PV_FIXEOL: return (char_u *)&(curbuf->b_p_fixeol);
case PV_ET: return (char_u *)&(curbuf->b_p_et);
case PV_FENC: return (char_u *)&(curbuf->b_p_fenc);
case PV_FF: return (char_u *)&(curbuf->b_p_ff);
@@ -5548,6 +5553,7 @@ void buf_copy_options(buf_T *buf, int flags)
buf->b_p_bin = p_bin;
buf->b_p_bomb = p_bomb;
buf->b_p_et = p_et;
+ buf->b_p_fixeol = p_fixeol;
buf->b_p_et_nobin = p_et_nobin;
buf->b_p_ml = p_ml;
buf->b_p_ml_nobin = p_ml_nobin;
@@ -6483,6 +6489,7 @@ void save_file_ff(buf_T *buf)
* from when editing started (save_file_ff() called).
* Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was
* changed and 'binary' is not set.
+ * Also when 'endofline' was changed and 'fixeol' is not set.
* When "ignore_empty" is true don't consider a new, empty buffer to be
* changed.
*/
@@ -6497,9 +6504,9 @@ bool file_ff_differs(buf_T *buf, bool ignore_empty)
&& *ml_get_buf(buf, (linenr_T)1, FALSE) == NUL)
return FALSE;
if (buf->b_start_ffc != *buf->b_p_ff)
- return TRUE;
- if (buf->b_p_bin && buf->b_start_eol != buf->b_p_eol)
- return TRUE;
+ return true;
+ if ((buf->b_p_bin || !buf->b_p_fixeol) && buf->b_start_eol != buf->b_p_eol)
+ return true;
if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb)
return TRUE;
if (buf->b_start_fenc == NULL)