nvim-telescope / telescope-file-browser.nvim

File Browser extension for telescope.nvim
MIT License
1.6k stars 89 forks source link

Do not create files on empty result #381

Closed AndreasNasman closed 2 months ago

AndreasNasman commented 2 months ago

Hi! 👋

Is it possible to suppress the behavior of creating files when pressing Enter if no results are found? I sometimes mistype a filename, which results in no matches, and if I press Enter without noticing, a file is created that I don't want. Can I disable this behavior and only create files using explicit create actions?

Example: I want to open the temp.lua file but accidentally type temm and press Enter, creating a temm file I don't want.

image

image image

image
jamestrew commented 2 months ago

Yeah I can see this as being annoying. I'll add an option to disable this feature. I'll try to do this in the over the next couple of days.

jamestrew commented 2 months ago

Added the option create_from_prompt. It defaults to true to preserve existing behavior but you can set it to false in your config to disable creating files/folders from the prompt when there are no results.