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

Sort the buffer picker by most recent access #2980

Merged
merged 5 commits into from
Apr 28, 2023

Conversation

estin
Copy link
Contributor

@estin estin commented Jul 5, 2022

Hi!

This is naive implementation of most-recent-used buffers picker.
As vim user in past this feature is very needs for me )

Sorry for my poor English.

@the-mikedavis
Copy link
Member

Should this be the default behavior of the buffer picker?

@estin
Copy link
Contributor Author

estin commented Jul 6, 2022

imho yes. this behavior must be default for buffer picker
may be some part of users prefer without any sorting.
It is must be decided by helix core team )

helix-view/src/document.rs Outdated Show resolved Hide resolved
@@ -662,6 +666,7 @@ impl Document {
if self.selections.get(&view_id).is_none() {
self.reset_selection(view_id);
}
self.used_at = std::time::SystemTime::now();
Copy link
Member

Choose a reason for hiding this comment

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

This seems to only be tracked when the document is first created?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no. works on each buffer switch. currently I use this feature right now )
And yes it was not clear.
Now doc.used_at updated only on pick in buffer picker.

@estin estin force-pushed the mru-buffer-picker branch from 0890279 to ef59117 Compare July 24, 2022 09:27
@estin estin requested a review from archseer July 24, 2022 09:28
@estin
Copy link
Contributor Author

estin commented Jul 29, 2022

@archseer hi!
Please check this PR again as you can.
Commits are squashed

@estin estin force-pushed the mru-buffer-picker branch from ef59117 to 38ececc Compare August 1, 2022 09:46
@kirawi kirawi added A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer. labels Sep 13, 2022
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

I've been testing this for a while and I like the behavior 👍

I left some minor comments

helix-term/src/commands.rs Outdated Show resolved Hide resolved
helix-term/src/commands.rs Outdated Show resolved Hide resolved
helix-view/src/document.rs Outdated Show resolved Hide resolved
@estin estin force-pushed the mru-buffer-picker branch from 38ececc to 4a32ee8 Compare November 7, 2022 06:36
@the-mikedavis the-mikedavis linked an issue Nov 16, 2022 that may be closed by this pull request
@estin estin force-pushed the mru-buffer-picker branch 2 times, most recently from c27c9b8 to 14b74aa Compare December 2, 2022 05:06
@estin estin requested review from the-mikedavis and removed request for archseer February 6, 2023 05:10
pascalkuthe
pascalkuthe previously approved these changes Apr 25, 2023
Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

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

The implementation LGTM. I like that you kept it simple 👍

@pascalkuthe pascalkuthe modified the milestones: next, 23.04 Apr 25, 2023
the-mikedavis
the-mikedavis previously approved these changes Apr 27, 2023
@pascalkuthe pascalkuthe dismissed stale reviews from the-mikedavis and themself via 1de7935 April 27, 2023 23:52
@pascalkuthe
Copy link
Member

(rebased on master, there were some small conflicts which were not obvious from the github UI so it looked like a CI problem instead)

@the-mikedavis the-mikedavis changed the title most recent used buffers picker Sort the buffer picker by most recent access Apr 28, 2023
@the-mikedavis the-mikedavis merged commit 6a1bb81 into helix-editor:master Apr 28, 2023
@the-mikedavis
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sort buffer picker results by most-recently-used
6 participants