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

On first Telescope frecency there is a A pretyped in telescope #270

Open
fishman opened this issue Oct 7, 2024 · 5 comments
Open

On first Telescope frecency there is a A pretyped in telescope #270

fishman opened this issue Oct 7, 2024 · 5 comments

Comments

@fishman
Copy link

fishman commented Oct 7, 2024

I don't know how to debug this, but whenever I do :Telescope frecency on the first vim start it shows an 'A' character prefilled in the Telescope window. Is there any way to see what that could be from?

@fishman
Copy link
Author

fishman commented Oct 7, 2024

      vim.keymap.set('n', '<leader>fr', require('telescope').extensions.frecency.frecency, { desc = '[F]ind Recent Files ("." for repeat)' })

After starting it manually with :Telescope frecency it asked me to remove 12 entries from the frecency database, and after agreeing to it the issue disappeared.

@delphinus
Copy link
Member

It might output some escape sequences with vim.ui.select dialog and you've seen a part of that: A, maybe.

Hmm……, I am thinking to disable this dialog in default for avoiding such annoyance.

@solson
Copy link

solson commented Oct 14, 2024

I also started noticing this behavior recently, and starting it manually with :Telescope frecency doesn't seem to help - that also just opens it with "A" pretyped (if it's the first run). I never get a dialog asking me to remove any entries.

@solson
Copy link

solson commented Oct 14, 2024

I did some git bisecting and found "673585ee997b40d2600eb86c3693d552e4f5d79f is the first bad commit".

Specifically, if I run :Telescope frecency before that commit, I get a popup saying [Telescope-Frecency] remove 16 entries from database?, but if I run :Telescope frecency any time after that commit, I get no popup and I get the prefilled A.

@solson
Copy link

solson commented Oct 14, 2024

On a separate note, I never understood what that popup was for, back when it worked. It doesn't specify what's special about the 16 entries it's asking me to delete, or why I would want to do so.

It seems like I will most likely either always say Yes or always say No, so maybe it could be a config boolean, and remove the need for a popup dialog entirely?

...on reviewing the code, I discovered there's already a flag for suppressing the popups. Setting db_safe_mode = false seems to stand for "always say Yes", and with this config setting I can use the newest commit in the repo without the prefilled A problem!

tl;dr @fishman if you see this issue re-occur and want a workaround, try setting db_safe_mode = false in the frecency config. (Official docs for more nuance.)

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

No branches or pull requests

3 participants