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

feat: precede opened or related buffers #274

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

delphinus
Copy link
Member

@delphinus delphinus commented Nov 25, 2024

Fix #272

This add a feature to precede relational entries to already opened ones.

preceding = nil (default value)

This is the original behavior. It does not precede any entries and just sort by score.

100  /path/to/project_A/index.html
 80  /path/to/project_B/Makefile
 60  /path/to/project_A/image.jpg
 40  /path/to/project_C/lib/main.ts
 20  /path/to/project_B/main.c
 10  /path/to/project_A/style.css

preceding = "opened"

When you opened project_A/image.jpg and project_B/Makefile, it precedes them against other candidates.

 80  /path/to/project_B/Makefile
 60  /path/to/project_A/image.jpg
100  /path/to/project_A/index.html
 40  /path/to/project_C/lib/main.ts
 20  /path/to/project_B/main.c
 10  /path/to/project_A/style.css

This is like :Telescope buffers because filenames in existent buffers are above others.

preceding = "same_repo"

When you opened the same files above, it precedes candidates that are under the same repositories.

100  /path/to/project_A/index.html
 80  /path/to/project_B/Makefile
 60  /path/to/project_A/image.jpg
 20  /path/to/project_B/main.c
 10  /path/to/project_A/style.css
 40  /path/to/project_C/lib/main.ts

@delphinus delphinus changed the title refactor: separate sorting logic to expand feat: precede opened and related buffers Nov 25, 2024
@delphinus delphinus changed the title feat: precede opened and related buffers feat: precede opened or related buffers Nov 25, 2024
@delphinus delphinus marked this pull request as ready for review November 30, 2024 07:16
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.

[feature] Option to rank opened files on the top of the rest
1 participant