rgieseke / textredux

Text-based interfaces for Textadept
http://rgieseke.github.io/textredux/
Other
58 stars 11 forks source link

Force-create (or open if it exists) a search query that otherwise fuzzy-matches an existing entry. #61

Closed BrandonIrizarry closed 4 years ago

BrandonIrizarry commented 4 years ago

For example, if I wish to create a file 'set.lua', but already have a file name 'settings.lua', the latter will be matched, forcing me to open that file, instead of letting me create the new file I want. Here, I have some code that binds "ctrl+n" to a "force-create" action; that is, if 'setttings.lua' is matched, I can still force the creation of the flie 'set.lua' with "ctrl+n". As a foolproof measure, if "ctrl+n" is used on an existing entry, that entry is simply opened (instead of being overwritten by a call to 'io.write').

I'm using this binding, and it's pretty handy :)

Hope this looks OK. My fear is that it's too specific of a solution (that is, it doesn't span all of Textredux), but hopefully it's a start.

rgieseke commented 4 years ago

That could be quite useful! Do you mean Ctrl+Enter as a shortcut (''\n") as in the source?

BrandonIrizarry commented 4 years ago

Ah yes, sorry :) Ctrl+Enter is the shortcut, in analogy to how Enter by itself would simply open the current selection. I also meant 'io.open', not 'io.write'; I apologize for that, too (that was actually weighing more on my mind than the 'n'/'\n' conflation, which I only noticed when you pointed it out.)

rgieseke commented 4 years ago

Merged! Thank you!