-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
keep jump/file history when using :split #3031
Conversation
helix-term/src/commands.rs
Outdated
view.docs_access_history = docs_access_history; | ||
view.last_modified_docs = last_modified_docs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to change these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternate file uses this, "space a"
helix-term/src/commands.rs
Outdated
let jumps = view.jumps.clone(); | ||
let docs_access_history = view.docs_access_history.clone(); | ||
let last_modified_docs = view.last_modified_docs; | ||
let object_selections = view.object_selections.clone(); | ||
let gutters = view.gutters.clone(); | ||
|
||
cx.editor.switch(id, action); | ||
|
||
// match the selection in the previous view | ||
let (view, doc) = current!(cx.editor); | ||
view.offset = offset; | ||
view.jumps = jumps; | ||
view.docs_access_history = docs_access_history; | ||
view.last_modified_docs = last_modified_docs; | ||
view.object_selections = object_selections; | ||
view.gutters = gutters; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about doing this inside switch
, under the split case? You should be able to just view.clone()
the current view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought that as well, but the offset was already here, so i just included it haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* keep jump/file history when using :split * move history cloning into the switch function Co-authored-by: Robin <robinvandijk@klippa.com>
i was missing the beheviour from vim