atom-open-recent icon indicating copy to clipboard operation
atom-open-recent copied to clipboard

Add option to disable command palette listing

Open danielbayley opened this issue 9 years ago • 9 comments

danielbayley avatar May 08 '16 21:05 danielbayley

Fairly certain that by not binding the command listeners with atom.commands.add "atom-workspace",, the menu won't work? Did you test that?

Zren avatar May 08 '16 21:05 Zren

You mean the File > Open Recent menu? I hadn't considered that, good point.

danielbayley avatar May 08 '16 21:05 danielbayley

@Zren Actually is it even possible to add commands without them showing up in the command palette?

danielbayley avatar May 08 '16 22:05 danielbayley

Not that I'm aware. Wasn't possible the last time I checked the command pallete package.

Zren avatar May 08 '16 22:05 Zren

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.

Zren avatar May 08 '16 22:05 Zren

PS, this is the file that filters the command pallete.

https://github.com/atom/command-palette/blob/master/lib/command-palette-view.coffee

Zren avatar May 08 '16 22:05 Zren

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… 💭

danielbayley avatar May 08 '16 22:05 danielbayley

That will hide the elements for sure, but does it prevent them from being selected?

Zren avatar May 08 '16 22:05 Zren

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 😆

danielbayley avatar May 08 '16 23:05 danielbayley