-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3992,12 +3992,23 @@ fn split(cx: &mut Context, action: Action) { | |
let id = doc.id(); | ||
let selection = doc.selection(view.id).clone(); | ||
let offset = view.offset; | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. How about doing this inside There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. should be fixed! |
||
|
||
doc.set_selection(view.id, selection); | ||
} | ||
|
||
|
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"