Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep jump/file history when using :split #3031

Merged
merged 2 commits into from
Jul 22, 2022
Merged

Conversation

robinvd
Copy link
Contributor

@robinvd robinvd commented Jul 11, 2022

i was missing the beheviour from vim

Comment on lines 4007 to 4008
view.docs_access_history = docs_access_history;
view.last_modified_docs = last_modified_docs;
Copy link
Contributor

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?

Copy link
Contributor Author

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"

Comment on lines 3995 to 4010
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;
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed!

Copy link
Member

@archseer archseer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@archseer archseer merged commit 19b7864 into helix-editor:master Jul 22, 2022
thomasskk pushed a commit to thomasskk/helix that referenced this pull request Sep 9, 2022
* keep jump/file history when using :split

* move history cloning into the switch function

Co-authored-by: Robin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants