On Thu, 22 Feb 2007 20:46:11 +0100, Enrico Tröger enrico.troeger@uvena.de wrote:
On Mon, 19 Feb 2007 14:57:39 +0100, Enrico Tröger enrico.troeger@uvena.de wrote:
On Sun, 18 Feb 2007 05:00:54 -0600, "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
Would any of the core developers care to offer some tips> here on how they'd go about adding such a feature?
Well I'm not a core developer, but in a nutshell, I think it would be something like:
sci_get_selected_text_length(); sci_get_selected_text() ; g_spawn_async_with_pipes(); sci_replace_sel();
Yes, looks quite good. I think I'll add this tomorrow. Seems to be a nice feature and isn't hard to implement.
Just for your interest: I'm about to implement this but it will still take some days...so please be patient.
It took some more days than expected and it wasn't that trivial ;-). But now it's in SVN and should work, at least a little bit.
You can define several custom commands and execute them via the edit and/or popup menu in Geany with SVN r1334. This only works if there is a selection. Then the selected text will be written to the standard input of the chosen command and its output on its standard output will be used to replace the selection. If the executed command prints any error messages on its standard error, these messages will be printed on Geany's standard output. My tests worked but I'm sure there might be some bugs in the code, so please test it.
The code needs further improvements in the future because there is somewhere a bug when writing and reading the commands pipes. I have workaround'ed it but it needs a fix not only a workaround ;-).
Currently, it doesn't work on Windows. Without any investigation, I guess it doesn't work because of the usage of pipes. Maybe anyone knows how to do it on Windows otherwise I would disable it for Windows.
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.key