mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Return key should only insert a newline if backslashed character is whitespace, or backslash terminates the line
https://github.com/fish-shell/fish-shell/issues/613
This commit is contained in:
parent
234fb7c2fe
commit
3b00d06a62
1 changed files with 6 additions and 5 deletions
11
reader.cpp
11
reader.cpp
|
@ -3247,13 +3247,14 @@ const wchar_t *reader_readline()
|
||||||
/* Delete any autosuggestion */
|
/* Delete any autosuggestion */
|
||||||
data->autosuggestion.clear();
|
data->autosuggestion.clear();
|
||||||
|
|
||||||
/*
|
/* Allow backslash-escaped newlines, but only if the following character is whitespace, or we're at the end of the text (see issue #163) */
|
||||||
Allow backslash-escaped newlines
|
|
||||||
*/
|
|
||||||
if (is_backslashed(data->command_line, data->buff_pos))
|
if (is_backslashed(data->command_line, data->buff_pos))
|
||||||
{
|
{
|
||||||
insert_char('\n');
|
if (data->buff_pos >= data->command_length() || iswspace(data->command_line.at(data->buff_pos)))
|
||||||
break;
|
{
|
||||||
|
insert_char('\n');
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (data->test_func(data->command_line.c_str()))
|
switch (data->test_func(data->command_line.c_str()))
|
||||||
|
|
Loading…
Reference in a new issue