So a ruby script could be:
#!/bin/ruby
# Some ruby code
thx, that is essentially what i did. but i used the $GEDIT_SELECTED_TEXT to
build a regexp to search for the matching code in the
$GEDIT_CURRENT_DOCUMENT. My problem is, that the $GEDIT_SELECTED_TEXT
variable has no newlines as i see it (which kind of makes sense if you pass
it to a shell script). However, it would be awesome, to either get the
current selected line numbers and not only the current line, or some sort of
text with escaped newlines.