mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-25 18:31:20 -03:00
Do not emit newline when running commands if the cursor is on its own line
If the cursor has been wrapped to the last line, and is the only thing on that line, do not emit a newline when executing a command. Fixes #6826
This commit is contained in:
@@ -1222,3 +1222,10 @@ void screen_force_clear_to_end() {
|
||||
}
|
||||
|
||||
screen_t::screen_t() : outp_(outputter_t::stdoutput()) {}
|
||||
|
||||
bool screen_t::cursor_is_wrapped_to_own_line() const {
|
||||
// Note == comparison against the line count is correct: we do not create a line just for the
|
||||
// cursor. If there is a line containing the cursor, then it means that line has contents and we
|
||||
// should return false.
|
||||
return actual.cursor.x == 0 && static_cast<size_t>(actual.cursor.y) == actual.line_count();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user