Plugin which wants to use the editor

Here you can discuss about your favorite plug-in.
Posts: 44
Joined: Wed May 03, 2006 5:10 pm

Plugin which wants to use the editor

Post by pepak » Wed Sep 12, 2007 1:49 pm

I would like to achieve this functionality:

Plugin generates a text with some control codes. Then it opens an internal editor and lets the user to modify the text. Finally, when the user closes the editor, the plugin reads the modified text and processes it in some way.

(Basically, what I described is much the same thing FRename plugin allows, so I know it is possible. I just don't know how to do it.)

Now, I would like to add one modification: I would like that editor window to color the text in a certain way, and perhaps respond to some special keystrokes - but ONLY for the text of my plugin.

For example, suppose the plugin read a list of selected files from the active panel and generated a batch file in the form of

Code: Select all

copy [filename_from_active_panel] [path_to_passive_panel]\[filename_from_active_panel]
I would like to modify the editor to
1) When F8 is pressed, change "copy" to "move" (and back)
2) Display the "copy" lines in red and "move" lines in green
But only for my plugin's texts, not for a file the user opened in the editor.

It it possible to write a plugin which does this?

User avatar
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod

Post by t-rex » Wed Sep 12, 2007 5:29 pm

Yes it is possible, and not very hard.

Posts: 1
Joined: Thu Sep 13, 2007 8:37 am

Post by johndoe » Thu Sep 13, 2007 9:04 am

There is another way - these 2 plugins can help you.

1) [ESC] Editor's settings changer
(it can assign special user set of macros depending on file's extension.
Plugin doc's language is russian, but all you need to know is in example file "esc_message.xml")

2) Colorer

Posts: 44
Joined: Wed May 03, 2006 5:10 pm

Post by pepak » Thu Sep 13, 2007 9:41 am

JohnDoe, that coloring was just an example - I realize I can do that with other plugins. What I wanted to know is if it is possible to use editor for my plugin's editational needs and provide some modifications which will only kick in if it is my plugin which called the editor. Apparently it is possible, when T-Rex said so, so I just need to find out how to do it :-)