mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-23 01:46:18 +04:00
Reset first_line when changing files.
This commit is contained in:
parent
915fd9ebaf
commit
4b176caded
@ -90,8 +90,9 @@ pub fn open(&mut self, path: PathBuf, action: Action) -> Result<DocumentId, Erro
|
||||
use crate::tree::Layout;
|
||||
match action {
|
||||
Action::Replace => {
|
||||
self.view_mut().doc = id;
|
||||
// TODO: reset selection?
|
||||
let view = self.view_mut();
|
||||
view.doc = id;
|
||||
view.first_line = 0;
|
||||
return Ok(id);
|
||||
}
|
||||
Action::HorizontalSplit => {
|
||||
|
Loading…
Reference in New Issue
Block a user