mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-11 18:40:35 +02:00
:actionlist added support for wildcards
This commit is contained in:
parent
edba90f188
commit
c6eeaed7da
@ -36,12 +36,14 @@ public class ActionListHandler extends CommandHandler {
|
||||
|
||||
public boolean execute(@NotNull Editor editor, @NotNull final DataContext context, @NotNull ExCommand cmd) throws ExException {
|
||||
String arg = cmd.getArgument().trim().toLowerCase();
|
||||
String args[] = arg.split("\\*");
|
||||
ActionManager aMgr = ActionManager.getInstance();
|
||||
String actionNames[] = aMgr.getActionIds("");
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String actionName : actionNames) {
|
||||
if (actionName.toLowerCase().contains(arg)) {
|
||||
if(match(actionName, args))
|
||||
{
|
||||
builder.append(actionName);
|
||||
AnAction action = aMgr.getAction(actionName);
|
||||
Shortcut[] shortcuts = action.getShortcutSet().getShortcuts();
|
||||
@ -58,4 +60,13 @@ public class ActionListHandler extends CommandHandler {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean match(String actionName, String args[]) {
|
||||
for (String argChunk : args) {
|
||||
if (!actionName.toLowerCase().contains(argChunk)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user