mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
Remove 'textmode' option
'textmode' is an option obsoleted for at least 10 years in favor of 'fileformat'.
This commit is contained in:

committed by
Thiago de Arruda

parent
a53f784738
commit
85b5a75a69
58
src/misc2.c
58
src/misc2.c
@@ -1147,41 +1147,41 @@ get_fileformat_force (
|
||||
return EOL_DOS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the current end-of-line type to EOL_DOS, EOL_UNIX or EOL_MAC.
|
||||
* Sets both 'textmode' and 'fileformat'.
|
||||
* Note: Does _not_ set global value of 'textmode'!
|
||||
*/
|
||||
void
|
||||
set_fileformat (
|
||||
int t,
|
||||
int opt_flags /* OPT_LOCAL and/or OPT_GLOBAL */
|
||||
)
|
||||
/// Set the current end-of-line type to EOL_UNIX, EOL_MAC, or EOL_DOS.
|
||||
///
|
||||
/// Sets 'fileformat'.
|
||||
///
|
||||
/// @param eol_style End-of-line style.
|
||||
/// @param opt_flags OPT_LOCAL and/or OPT_GLOBAL
|
||||
void set_fileformat(int eol_style, int opt_flags)
|
||||
{
|
||||
char *p = NULL;
|
||||
char *p = NULL;
|
||||
|
||||
switch (t) {
|
||||
case EOL_DOS:
|
||||
p = FF_DOS;
|
||||
curbuf->b_p_tx = TRUE;
|
||||
break;
|
||||
case EOL_UNIX:
|
||||
p = FF_UNIX;
|
||||
curbuf->b_p_tx = FALSE;
|
||||
break;
|
||||
case EOL_MAC:
|
||||
p = FF_MAC;
|
||||
curbuf->b_p_tx = FALSE;
|
||||
break;
|
||||
switch (eol_style) {
|
||||
case EOL_UNIX:
|
||||
p = FF_UNIX;
|
||||
break;
|
||||
case EOL_MAC:
|
||||
p = FF_MAC;
|
||||
break;
|
||||
case EOL_DOS:
|
||||
p = FF_DOS;
|
||||
break;
|
||||
}
|
||||
if (p != NULL)
|
||||
set_string_option_direct((char_u *)"ff", -1, (char_u *)p,
|
||||
OPT_FREE | opt_flags, 0);
|
||||
|
||||
/* This may cause the buffer to become (un)modified. */
|
||||
// p is NULL if "eol_style" is EOL_UNKNOWN.
|
||||
if (p != NULL) {
|
||||
set_string_option_direct((char_u *)"ff",
|
||||
-1,
|
||||
(char_u *)p,
|
||||
OPT_FREE | opt_flags,
|
||||
0);
|
||||
}
|
||||
|
||||
// This may cause the buffer to become (un)modified.
|
||||
check_status(curbuf);
|
||||
redraw_tabline = TRUE;
|
||||
need_maketitle = TRUE; /* set window title later */
|
||||
need_maketitle = TRUE; // Set window title later.
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user