mirror of
https://github.com/nushell/reedline.git
synced 2024-09-11 15:55:50 +03:00
Try fix prompt_start_row reset to 0 when opening a file without newline in Nushell (#697)
* adjust is_reset
* add a word
* Revert "add a word"
This reverts commit e61be57724
.
This commit is contained in:
parent
aa101f4d69
commit
b68ce33c75
@ -153,7 +153,10 @@ impl Painter {
|
||||
|
||||
// This might not be terribly performant. Testing it out
|
||||
let is_reset = || match cursor::position() {
|
||||
Ok(position) => position.1.abs_diff(self.prompt_start_row) > 1,
|
||||
// when output something without newline, the cursor position is at current line.
|
||||
// but the prompt_start_row is next line.
|
||||
// in this case we don't want to reset, need to `add 1` to handle for such case.
|
||||
Ok(position) => position.1 + 1 < self.prompt_start_row,
|
||||
Err(_) => false,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user