Filters

Here you can discuss about your favorite plug-in.
pepak
Posts: 369
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 5 times
Been thanked: 11 times

Filters

Post by pepak » Tue 27 Mar, 2018 17:30

Latest post of the previous page:

So far:
  • Added the history support.
  • Fixed incorrect end-of-line on the last line.
  • FIxed the EConvertError.
Other comments:
  • I think I have a clear idea of how to implement the parameters-just-before-execution.
  • FAR-like metacharacters won't be supported. Way too much work for too little gain. Percentages will stay.
  • Undo seems to be a bug in FAR rather than in the plugin. Even if I move the creation of undo block before any other operation, the cursor still doesn't return to the original place.
  • Found an error with executing the plugin when the curor is outside of the selected block. Will fix.

pepak
Posts: 369
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 5 times
Been thanked: 11 times

Filters

Post by pepak » Tue 27 Mar, 2018 17:32

HaRT wrote:
Tue 27 Mar, 2018 14:41
I did not mean metacharacters in general. I rather suggested the particular parameters input syntax I mentioned: !?$<history>$<title>?<init>!. Is it familiar to you?
Yes, but I won't be implementing that.
What do unescaped percent signs mean? A hint would be useful somewhere in the dialog (or at least in the docs).
readme.en.txt, line 112-124.
But please note that the dialogs are totally unusable after the error now. Or is it what you mean by “untranslated”?
Change the string "Unknown '%%%c' at position %d - configuration is invalid" in the language file to "Unknown '%%%s' at position %d - configuration is invalid" and the error is gone.

User avatar
HaRT
Moderator
Posts: 8418
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 73 times
Been thanked: 127 times

Filters

Post by HaRT » Tue 27 Mar, 2018 18:19

pepak wrote:
Tue 27 Mar, 2018 17:32
readme.en.txt, line 112-124.
Indeed! I managed to forget this between reading the docs when I first saw the plugin and creating my first external filter yesterday. I changed the label this way: "&Command template (%i Input, %o Output, %w Width, %% percent)" for it to be my hint.
pepak wrote:
Tue 27 Mar, 2018 17:32
Change the string […] and the error is gone.
Thanks.
Фар есть инструмент, а не нянька. © 2009 DrKnS

pepak
Posts: 369
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 5 times
Been thanked: 11 times

Filters

Post by pepak » Fri 30 Mar, 2018 11:04

Released version 0.03
  • Added support for plugin-call to a named filter. This allows calling of external filters which weren't available to plugin-calls in previous versions. Use the Filters.ExecuteByName script function; as an argument, provide the description of your filter, as entered into the filter's configuration.
  • Added support for a filter reconfiguration just before use. The purpose of this feature is to allow a modification of arguments of an external filter as per immediate requirements without having to create multiple filter configurations in advance. Just mark the filter as "Edit before use" and you will be asked to modify the filter settings before use.
  • Added support for combined STDOUT and STDERR output to the external filters.
  • Added history support to edit fields in the dialogs.
  • Fixed: After editing a filter's configuration, the selection of the filter list moved to the first item. Now it will stay at the edited item.
  • Fixed: If the filter was run against a selection and the filtered output ended with a newline, that newline got discarded and the first line after the selection got appended to the last line of the output.
  • Fixed: With persistent blocks enabled, if the cursor was outside of the selection at the time the plugin was executed, the filtered output would get written at the cursor position (i.e. inside some completely unrelated section of the file).
  • Moved the definition of the start of the undo block before any other operation on the editor's content in the hope that it would include the cursor movement into an Undo, if the user decided to use it. Unfortunately, it seems that FAR does not consider cursor movements a part of the Undo block (FAR3 build 5134).
  • Fixed an EConvertError exception when entering incorrect % modifiers into the external filter's command template.
Source codes can't be uploaded to PlugRing due to 413 Request Entity Too Large.

User avatar
HaRT
Moderator
Posts: 8418
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 73 times
Been thanked: 127 times

Filters

Post by HaRT » Fri 30 Mar, 2018 14:31

pepak wrote:
Fri 30 Mar, 2018 11:04
Released version 0.03
Thanks a lot!

A minor glitch: if I change a filter in another (second) instance of Far, I then see the changes in the plugin's configuration in the first instance, but if I open an editor there (in the first instance), the old configuration is still in effect.

And a minor wish: if the external filter cannot be executed (e.g. inaccessible executable), please restore/ don't clear the selection.
Фар есть инструмент, а не нянька. © 2009 DrKnS

pepak
Posts: 369
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 5 times
Been thanked: 11 times

Filters

Post by pepak » Fri 30 Mar, 2018 14:42

HaRT wrote:
Fri 30 Mar, 2018 14:31
A minor glitch: if I change a filter in another (second) instance of Far, I then see the changes in the plugin's configuration in the first instance, but if I open an editor there (in the first instance), the old configuration is still in effect.
That's more or less by design. It could be changed with a minor effort, but I rather liked the effect of having an "active" set of filters and a set of "stored" filters. Plus it somewhat speeds up the plugin execution (I guess by as much as a few microseconds :-)). But I will think about it.
And a minor wish: if the external filter cannot be executed (e.g. inaccessible executable), please restore/ don't clear the selection.
That might be a lot more difficult than it looks, actually. I will see.

pepak
Posts: 369
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 5 times
Been thanked: 11 times

Filters

Post by pepak » Sat 14 Apr, 2018 06:26

HaRT wrote:
Fri 30 Mar, 2018 14:31
A minor glitch: if I change a filter in another (second) instance of Far, I then see the changes in the plugin's configuration in the first instance, but if I open an editor there (in the first instance), the old configuration is still in effect.
Fixed in 0.04 (not yet released).
And a minor wish: if the external filter cannot be executed (e.g. inaccessible executable), please restore/ don't clear the selection.
As far as I can tell, that is done by FAR, not me. At least, I couldn't find any place in my code where I could terminate the plugin and still keep the selection alive.

pepak
Posts: 369
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 5 times
Been thanked: 11 times

Filters

Post by pepak » Sun 15 Apr, 2018 07:28

Released version 0.04
  • In the filter configuration dialog, you can press the Copy button or keys F5 or CTRL+C to make a copy of the selected filter.
  • If a filter is set to "edit before use", its configuration dialog contains a new checkbox to let you save the modified settings to the configuration to make them permanent.
  • Filter list is always loaded just before use. As a result, if multiple instances of FAR are running and you change the plugin's configuration in one of them, it will immediately apply to all of them.
  • If a filter set to "edit before use" was called from a script, it would execute immediately without displaying the configuration dialog.

Post Reply

Return to “General Plug-In Discussions”