atom-open-recent
atom-open-recent copied to clipboard
Add option to disable command palette listing
Fairly certain that by not binding the command listeners with atom.commands.add "atom-workspace",, the menu won't work? Did you test that?
You mean the File > Open Recent menu?
I hadn't considered that, good point.
@Zren Actually is it even possible to add commands without them showing up in the command palette?
Not that I'm aware. Wasn't possible the last time I checked the command pallete package.
We could either request a new property that the command pallete will ignore the command if set, or have a config option to toggle off the path names in the command name and use the old open-recent-file-2.
PS, this is the file that filters the command pallete.
https://github.com/atom/command-palette/blob/master/lib/command-palette-view.coffee
Actually, just a simple little bit of Less will do it…
.command-palette li[data-event-name^="open-recent"] { display: none }
How to conditionally apply styles… 💭
That will hide the elements for sure, but does it prevent them from being selected?
Actually the correct Less would be:
.command-palette li[data-event-name^="open-recent:Dir"],
[data-event-name^="open-recent:File"] { display: none }
does it prevent them from being selected?
It works well unless you use keyboard navigation on the command palette (so you're right…)
Damn; this is trickier than I anticipated… I'm just trying to de-clutter my command palette a bit 😆