Introduce KTextEditor::Command to libkateprivate for scripting
Kate doesn't have any scripting capabilities atm. KTextEditor does have scripting but you are strictly limited to a single document. However there is a small escape hatch which we can use to allow scripting Kate, controlling its UI to some degree and perhaps automate things. That escape hatch is view.executeCommand() which can execute any registered KTextEditor::Command.
This commit adds a couple of commands to KateMainWindow:
- showtoolview
- hidetoolview
which can be invoked from a script to show or hide a toolview. I realize this is very basic, but atm we are just testing things and starting small is always a good idea imo.
Its a pity that commands like "mainwindow.showtoolview" don't work, even though they get registered. It would be a good idea to namespace things like that, makes it easier to find stuff/remember them.
There are of course limitation in the Command interface. The primary limitation atm is that you can only execute a command to do something. You can't use it to fetch some data as the command::exec() has no return capabilities.