Hi Farsheed,
It’s great to know you’re pushing mapy forward
I think it’s a perfectly reasonable change, except for that the last variable might specify the selection length instead. At least that’s the data available to me from PsPad. I would assume it is available through Crimson Editor, SciTE and other popular editors (it’s for sure available in monsters like vim or emacs).
I don’t see any easier way of specifying the part of the script file to execute, given you are calling an external command with specific parameters. I did not succeed in parsing text that contains
character from the editor to even the simplest batch script. The command line interpreter cuts the argument stream as soon as it encounters that character.
So yep, passing 2 optional numbers that specify start and end (or length) of the selection sounds like the simple and effective way to solve the problem.
In wost case (for an editor that does not provide this info) I think that this problem could be solved using some scripting for the specific editor. For isntance by writing a script that would read the selection, write it to the file and call mapy with that file as an argument, then delete the file (optionally).
Let me know your thoughts.
Looking forward to the new version