-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minibuffer command list does not show user-added commands #173
Comments
@tbpassin Thanks for creating this issue. I'm not sure the good/bad lists are the culprit, but that's just speculation on my part. |
the method in leoserver is called get_all_leo_commands, it's getting its base list from c.commandsDict. I'm gonna check why / how at-commands dont end up there. i'm new to those so go ahead if you have thoughts about that ! :) |
I'll assign it to you - although it should be done in Leo-editor's leoserver.py instead of leointeg ( i might be wrong - feel free to comment or whatever you feel appropriate) |
It is the user-defined command that aren't showing up. These are ones whose headline starts with @command. I know that commands in specific outline aren't getting listed. I'm not sure about commands defined in myLeoSettings.leo, but my guess is that they aren't either. When leointeg sees a headline beginning with @button, it creates a button bound to that command. So that part works as expected. When such a button gets pressed, it can fire a user-defined command, and that works. If @commands get added to the Leo command editbox, it would need to be on a per-outline basis. I don't know if the current leointeg design can do that or not. |
@boltex I'll do this next. BTW, unless there are serious doubts about a commit, I recommend merging dev into master almost immediately. That way we can all just pull master and be sure that we are getting the latest code. In other words, I think we should all be testing new code asap. Worst case: we check out a previous rev in master. |
@tbpassin Should be straightforward to fix. |
Background: Within Leo itself, commands created by
The minibuffer will also show the same commands without the
|
As a prototype, the following Leonine script prints all unique command names, that is, c.commandsDict keys, with duplicate command-names deleted. The script also deletes Leo's vim-mode-related commands, that is, commands starting with ':'. def unique_commands():
return (key for key in c.commandsDict
if not key.startswith(('@button-', '@command-', ':')))
g.printObj(sorted(unique_commands())) |
@boltex I agree that the new code should be in leoserver.py. |
A trace in server.get_all_leo_commands shows that c.commandsDict contains no entries starting with |
Update: There are several bugs, all in leoserver.py. self.dummy_c = g.app.newCommander(fileName=None) Alas, g.app.newCommander never reads settings, so the dummy commander has no chance of knowing about Happily, this bug is easy to fix:
Now another bug appears:
This is almost expected :-) In mod_scripting.py, in sc.registerAllCommands, the code registers the command name without the |
I am going to close this. However, see #180. |
Update: See Leo issue 2093.
I have some custom commands that are not bound to keys or buttons. They do not show up in leointeg's minibuffer command list. How can I run them without binding them to to a button?
I know that the Bridge code includes lists of commands that are allowed or disallowed. I can see the sense of that. But it leaves my own custom commands out in the cold.
The text was updated successfully, but these errors were encountered: