Feat+run cmd on match#399
Conversation
Easier debugging: some Python exception error messages are difficult to interpret without the exception type (e.g. KeyError).
- Plugins starting with underscore will not be displayed by the preference/plugins window. - This allow to add URLhandlers plugins on-the-fly. - Add the RunCmdOnMatch plugin, which creates URLhandlers plugins based on a regexp/command pair. - If an URLhandler plugin returns a prepared URL starting with "terminator://", then terminator will not try to open it with the URL handler (like xdg-open).
|
Sorry for letting this drop for so long. I actually love this feature and I think the code changes are mostly good. I checked it out and tried to use the example you put in the description, but I can't seem to figure out how to click on the text so that it brings up the command. It should underline the line and that should let me click on it, but it doesn't seem to do that. Is there something I'm missing? |
|
The full test procedure would goes: Run a script that display the info to catch, here a Python script displaying THE ABSOLUTE PATH. echo "print('What the F)" > test.py
python3 $(pwd)/test.pyNote that if you just do Then, you have to pass the mouse over the path segment to see it underlined, and [Ctrl-] click to open it. |
|
Huh. that's what I thought I did, but I'll try again. Tried again. Worked. It may have been my gvim command. Merging. Thanks so much for this, and sorry it took me so long to get around to looking at it. |
|
Awesome, thanks!
--
nojhan
…On Tue, Apr 13, 2021 at 10:47 PM Matt Rose ***@***.***> wrote:
Merged #399 <#399>
into master.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#399 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACFSUPQVM3WLHTIYW4QELTTISUXNANCNFSM4YT57WEA>
.
|

Adds the necessary features to add a regexp/command plugin.
My use-case is to be able to open a file at a specific line in my IDE, just by clicking on an error message.
For instance, for opening a python script indicated in a python error, within vim, use the following configuration with the RunCmdOnMatch plugin implemented in this PR:
\B(/\S+?\.py)\S{2}\sline\s(\d+)gvim --servername IDE --remote +{1} {0}This adds three interconnected features:
terminator://URL.The overall architecture is not really elegant, but it is the smallest footprint I found for implementing a match/command plugin.
It needs a URLhandler metaclass and will instantiate on-the-fly one plugin per configured match/command pair (hence the necessity to hide them, as the user is not supposed to interact with them anyway).
As those hidden plugins are responsible for "opening" the URL they match, a way to bypass the URL handler was needed. Returning
Nonealready had a semantic, so I opted for a fake protocol in the URI.The GUI code is almost a copy/paste of the custom commands plugin, so it would be better to have the plugin window's entry point (instead of the contextual menu) and keep a single code base.
I'm not sure where to edit a user documentation.