mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.0817
This commit is contained in:
@@ -3052,6 +3052,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'endofline' 'eol' boolean (default on)
|
'endofline' 'eol' boolean (default on)
|
||||||
local to buffer
|
local to buffer
|
||||||
When writing a file and this option is off and the 'binary' option
|
When writing a file and this option is off and the 'binary' option
|
||||||
|
is on, or 'fixeol' option is off, no CTRL-Z will be written for at the
|
||||||
|
end of the file.
|
||||||
|
|
||||||
|
*'endofline'* *'eol'* *'noendofline'* *'noeol'*
|
||||||
|
'endofline' 'eol' boolean (default on)
|
||||||
|
local to buffer
|
||||||
|
When writing a file and this option is off and the 'binary' option
|
||||||
is on, or 'fixeol' option is off, no <EOL> will be written for the
|
is on, or 'fixeol' option is off, no <EOL> will be written for the
|
||||||
last line in the file. This option is automatically set or reset when
|
last line in the file. This option is automatically set or reset when
|
||||||
starting to edit a new file, depending on whether file has an <EOL>
|
starting to edit a new file, depending on whether file has an <EOL>
|
||||||
@@ -3452,7 +3459,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'fixendofline' 'fixeol' boolean (default on)
|
'fixendofline' 'fixeol' boolean (default on)
|
||||||
local to buffer
|
local to buffer
|
||||||
When writing a file and this option is on, <EOL> at the end of file
|
When writing a file and this option is on, <EOL> at the end of file
|
||||||
will be restored if missing. Turn this option off if you want to
|
will be restored if missing. Turn this option off if you want to
|
||||||
preserve the situation from the original file.
|
preserve the situation from the original file.
|
||||||
When the 'binary' option is set the value of this option doesn't
|
When the 'binary' option is set the value of this option doesn't
|
||||||
matter.
|
matter.
|
||||||
|
@@ -355,7 +355,7 @@ CClink = $(CC)
|
|||||||
#CONF_OPT_GUI = --enable-gui=gnome2 --disable-gtktest
|
#CONF_OPT_GUI = --enable-gui=gnome2 --disable-gtktest
|
||||||
#CONF_OPT_GUI = --enable-gui=gtk3
|
#CONF_OPT_GUI = --enable-gui=gtk3
|
||||||
#CONF_OPT_GUI = --enable-gui=gtk3 --disable-gtktest
|
#CONF_OPT_GUI = --enable-gui=gtk3 --disable-gtktest
|
||||||
#CONF_OPT_GUI = --enable-gui=motif
|
CONF_OPT_GUI = --enable-gui=motif
|
||||||
#CONF_OPT_GUI = --enable-gui=motif --with-motif-lib="-static -lXm -shared"
|
#CONF_OPT_GUI = --enable-gui=motif --with-motif-lib="-static -lXm -shared"
|
||||||
|
|
||||||
# Uncomment this line to run an individual test with gvim.
|
# Uncomment this line to run an individual test with gvim.
|
||||||
|
@@ -2050,6 +2050,10 @@ restore_backup:
|
|||||||
len = 0;
|
len = 0;
|
||||||
write_info.bw_start_lnum = lnum;
|
write_info.bw_start_lnum = lnum;
|
||||||
}
|
}
|
||||||
|
if (!buf->b_p_fixeol && buf->b_p_eof)
|
||||||
|
// write trailing CTRL-Z
|
||||||
|
(void)write_eintr(write_info->bw_fd, "\x1a", 1);
|
||||||
|
|
||||||
// write failed or last line has no EOL: stop here
|
// write failed or last line has no EOL: stop here
|
||||||
if (end == 0
|
if (end == 0
|
||||||
|| (lnum == end
|
|| (lnum == end
|
||||||
|
@@ -929,8 +929,6 @@ do_bang(
|
|||||||
STRCAT(t, newcmd);
|
STRCAT(t, newcmd);
|
||||||
if (ins_prevcmd)
|
if (ins_prevcmd)
|
||||||
STRCAT(t, prevcmd);
|
STRCAT(t, prevcmd);
|
||||||
else
|
|
||||||
vim_free(t);
|
|
||||||
p = t + STRLEN(t);
|
p = t + STRLEN(t);
|
||||||
STRCAT(t, trailarg);
|
STRCAT(t, trailarg);
|
||||||
vim_free(newcmd);
|
vim_free(newcmd);
|
||||||
|
@@ -590,6 +590,7 @@ readfile(
|
|||||||
if (!read_buffer)
|
if (!read_buffer)
|
||||||
{
|
{
|
||||||
curbuf->b_p_eol = TRUE;
|
curbuf->b_p_eol = TRUE;
|
||||||
|
curbuf->b_p_eof = FALSE;
|
||||||
curbuf->b_start_eol = TRUE;
|
curbuf->b_start_eol = TRUE;
|
||||||
}
|
}
|
||||||
curbuf->b_p_bomb = FALSE;
|
curbuf->b_p_bomb = FALSE;
|
||||||
@@ -2278,13 +2279,15 @@ failed:
|
|||||||
&& !got_int
|
&& !got_int
|
||||||
&& linerest != 0
|
&& linerest != 0
|
||||||
&& !(!curbuf->b_p_bin
|
&& !(!curbuf->b_p_bin
|
||||||
&& fileformat == EOL_DOS
|
&& fileformat == EOL_DOS))
|
||||||
&& *line_start == Ctrl_Z
|
|
||||||
&& ptr == line_start + 1))
|
|
||||||
{
|
{
|
||||||
// remember for when writing
|
// remember for when writing
|
||||||
if (set_options)
|
if (set_options)
|
||||||
|
{
|
||||||
curbuf->b_p_eol = FALSE;
|
curbuf->b_p_eol = FALSE;
|
||||||
|
if (*line_start == Ctrl_Z && ptr == line_start + 1)
|
||||||
|
curbuf->b_p_eof = FALSE;
|
||||||
|
}
|
||||||
*ptr = NUL;
|
*ptr = NUL;
|
||||||
len = (colnr_T)(ptr - line_start + 1);
|
len = (colnr_T)(ptr - line_start + 1);
|
||||||
if (ml_append(lnum, line_start, len, newfile) == FAIL)
|
if (ml_append(lnum, line_start, len, newfile) == FAIL)
|
||||||
|
@@ -555,6 +555,7 @@ EXTERN char_u *p_efm; // 'errorformat'
|
|||||||
EXTERN char_u *p_gefm; // 'grepformat'
|
EXTERN char_u *p_gefm; // 'grepformat'
|
||||||
EXTERN char_u *p_gp; // 'grepprg'
|
EXTERN char_u *p_gp; // 'grepprg'
|
||||||
#endif
|
#endif
|
||||||
|
EXTERN int p_eof; // 'endoffile'
|
||||||
EXTERN int p_eol; // 'endofline'
|
EXTERN int p_eol; // 'endofline'
|
||||||
EXTERN int p_ek; // 'esckeys'
|
EXTERN int p_ek; // 'esckeys'
|
||||||
EXTERN char_u *p_ei; // 'eventignore'
|
EXTERN char_u *p_ei; // 'eventignore'
|
||||||
@@ -1123,6 +1124,7 @@ enum
|
|||||||
, BV_DEF
|
, BV_DEF
|
||||||
, BV_INC
|
, BV_INC
|
||||||
#endif
|
#endif
|
||||||
|
, BV_EOF
|
||||||
, BV_EOL
|
, BV_EOL
|
||||||
, BV_FIXEOL
|
, BV_FIXEOL
|
||||||
, BV_EP
|
, BV_EP
|
||||||
|
@@ -61,6 +61,7 @@
|
|||||||
# define PV_DEF OPT_BOTH(OPT_BUF(BV_DEF))
|
# define PV_DEF OPT_BOTH(OPT_BUF(BV_DEF))
|
||||||
# define PV_INC OPT_BOTH(OPT_BUF(BV_INC))
|
# define PV_INC OPT_BOTH(OPT_BUF(BV_INC))
|
||||||
#endif
|
#endif
|
||||||
|
#define PV_EOF OPT_BUF(BV_EOF)
|
||||||
#define PV_EOL OPT_BUF(BV_EOL)
|
#define PV_EOL OPT_BUF(BV_EOL)
|
||||||
#define PV_FIXEOL OPT_BUF(BV_FIXEOL)
|
#define PV_FIXEOL OPT_BUF(BV_FIXEOL)
|
||||||
#define PV_EP OPT_BOTH(OPT_BUF(BV_EP))
|
#define PV_EP OPT_BOTH(OPT_BUF(BV_EP))
|
||||||
@@ -846,7 +847,7 @@ static struct vimoption options[] =
|
|||||||
{"edcompatible","ed", P_BOOL|P_VI_DEF,
|
{"edcompatible","ed", P_BOOL|P_VI_DEF,
|
||||||
(char_u *)&p_ed, PV_NONE,
|
(char_u *)&p_ed, PV_NONE,
|
||||||
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
|
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
|
||||||
{"emoji", "emo", P_BOOL|P_VI_DEF|P_RCLR,
|
{"emoji", "emo", P_BOOL|P_VI_DEF|P_RCLR,
|
||||||
(char_u *)&p_emoji, PV_NONE,
|
(char_u *)&p_emoji, PV_NONE,
|
||||||
{(char_u *)TRUE, (char_u *)0L}
|
{(char_u *)TRUE, (char_u *)0L}
|
||||||
SCTX_INIT},
|
SCTX_INIT},
|
||||||
@@ -854,6 +855,9 @@ static struct vimoption options[] =
|
|||||||
(char_u *)&p_enc, PV_NONE,
|
(char_u *)&p_enc, PV_NONE,
|
||||||
{(char_u *)ENC_DFLT, (char_u *)0L}
|
{(char_u *)ENC_DFLT, (char_u *)0L}
|
||||||
SCTX_INIT},
|
SCTX_INIT},
|
||||||
|
{"endoffile", "eof", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT,
|
||||||
|
(char_u *)&p_eof, PV_EOF,
|
||||||
|
{(char_u *)TRUE, (char_u *)0L} SCTX_INIT},
|
||||||
{"endofline", "eol", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT,
|
{"endofline", "eol", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT,
|
||||||
(char_u *)&p_eol, PV_EOL,
|
(char_u *)&p_eol, PV_EOL,
|
||||||
{(char_u *)TRUE, (char_u *)0L} SCTX_INIT},
|
{(char_u *)TRUE, (char_u *)0L} SCTX_INIT},
|
||||||
|
@@ -2999,6 +2999,7 @@ struct file_buffer
|
|||||||
char_u *b_p_tfu; // 'tagfunc' option value
|
char_u *b_p_tfu; // 'tagfunc' option value
|
||||||
callback_T b_tfu_cb; // 'tagfunc' callback
|
callback_T b_tfu_cb; // 'tagfunc' callback
|
||||||
#endif
|
#endif
|
||||||
|
int b_p_eof; // 'endoffile'
|
||||||
int b_p_eol; // 'endofline'
|
int b_p_eol; // 'endofline'
|
||||||
int b_p_fixeol; // 'fixendofline'
|
int b_p_fixeol; // 'fixendofline'
|
||||||
int b_p_et; // 'expandtab'
|
int b_p_et; // 'expandtab'
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
" Tests for 'fixeol' and 'eol'
|
" Tests for 'fixeol', 'eof' and 'eol'
|
||||||
|
|
||||||
func Test_fixeol()
|
func Test_fixeol()
|
||||||
" first write two test files – with and without trailing EOL
|
" first write two test files – with and without trailing EOL
|
||||||
" use Unix fileformat for consistency
|
" use Unix fileformat for consistency
|
||||||
set ff=unix
|
set ff=unix
|
||||||
enew!
|
enew!
|
||||||
call setline('.', 'with eol')
|
call setline('.', 'with eol or eof')
|
||||||
w! XXEol
|
w! XXEol
|
||||||
enew!
|
enew!
|
||||||
set noeol nofixeol
|
set noeof noeol nofixeol
|
||||||
call setline('.', 'without eol')
|
call setline('.', 'without eol or eof')
|
||||||
w! XXNoEol
|
w! XXNoEol
|
||||||
set eol fixeol
|
set eol eof fixeol
|
||||||
bwipe XXEol XXNoEol
|
bwipe XXEol XXNoEol
|
||||||
|
|
||||||
" try editing files with 'fixeol' disabled
|
" try editing files with 'fixeol' disabled
|
||||||
@@ -44,7 +44,7 @@ func Test_fixeol()
|
|||||||
call delete('XXNoEol')
|
call delete('XXNoEol')
|
||||||
call delete('XXTestEol')
|
call delete('XXTestEol')
|
||||||
call delete('XXTestNoEol')
|
call delete('XXTestNoEol')
|
||||||
set ff& fixeol& eol&
|
set ff& fixeol& eof& eol&
|
||||||
enew!
|
enew!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -695,6 +695,10 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
817,
|
||||||
|
/**/
|
||||||
|
816,
|
||||||
/**/
|
/**/
|
||||||
815,
|
815,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user