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

buffers picker: add select_current option (PR included) #2917

Closed
dam9000 opened this issue Feb 13, 2024 · 2 comments · Fixed by #2918 or #3147
Closed

buffers picker: add select_current option (PR included) #2917

dam9000 opened this issue Feb 13, 2024 · 2 comments · Fixed by #2918 or #3147
Labels
enhancement Enhancement to performance, inner workings or existent features

Comments

@dam9000
Copy link
Contributor

dam9000 commented Feb 13, 2024

Is your feature request related to a problem? Please describe.

With the buffers picker I'd like the current buffer to be pre-selected, but I don't like the buffer list to be mru sorted.
So that I can either navigate to nearby buffers using arrow keys or do a fuzzy search as usual.

Describe the solution you'd like

add select_current option to buffers picker.

Describe alternatives you've considered

none

Additional context

I opened a PR with the proposed change:

#2918

Example usage:

    vim.keymap.set('n', '<M-b>', function()
    require('telescope.builtin').buffers {
        select_current = true,
        selection_strategy = 'closest',
    }
    end, { desc = 'Buffer list' })
@dam9000 dam9000 added the enhancement Enhancement to performance, inner workings or existent features label Feb 13, 2024
@dam9000 dam9000 changed the title buffers picker: add select_current option (patch included) buffers picker: add select_current option (PR included) Feb 15, 2024
@pirey
Copy link
Contributor

pirey commented Jun 7, 2024

the select_current option is not working as expected.
it does not select current buffer by default.
i created a PR to fix it in #3147

@dam9000
Copy link
Contributor Author

dam9000 commented Jun 7, 2024

@pirey thanks for improving this. I too noticed that in some occasions it was not working properly, from my observations it was working only for the files that were provided through the command line but not for any new files opened afterwards from within nvim. I have tested your PR and now that works too.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to performance, inner workings or existent features
Projects
None yet
2 participants