If your Custom Command outputs some text, it's not inserted in the cursor place, it replaced the whole line. Steps to reproduce:
1. Open Edit -> Format -> Send Selection to -> Set Custom Commands 2. Add new command `echo "foobar"`, click `Ok` 3. Place the cursor in empty line and type some text. For example `important text` 4. Press Ctrl+1 to perform the created command. Number may differ if it's not your first custom command.
Result: the line has been completely replaced by `foobar` text. Expected result: the `foobar` added after the `important text`
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1035
This is the correct documented behaviour, see [the manual](http://www.geany.org/manual/current/index.html#sending-text-through-custom-c...) "If there is no selection, the whole current line is used instead."
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1035#issuecomment-219176527
I wonder why developers decided to replace the whole line? If someone wants to insert some text, he/she can do it on empty line. I don't see how replacing can be useful. Ok, count this issue as feature request of option that toggle this behavior.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1035#issuecomment-219205430
@meequz probably because custom commands are meant to have text piped through them, so if there's no selection, it uses the current line in order to have something to send through the command. If you want more powerful/flexible external tools feature, there are at least a few plugins out there to do this. If you want to change this to a feature request, it might be useful to close it and open a new issue for the request, or at least edit the title/description of this issue to reflect that.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1035#issuecomment-219206199
@meequz if you want a different feature that behaves in a different way to custom-commands certainly make a feature request as @codebrainz suggests.
IIUC one of the Geany contributors has a prototype of an addition that supports all the combinations, run command and insert the output, run a command with input from the buffer but don't paste the output, and the current behaviour. An issue that requests the right thing may elevate completing that in his personal priorities list.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1035#issuecomment-219206642
Ok, thanks everyone for explanations.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1035#issuecomment-219207873
Closed #1035.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/1035#event-660663780
github-comments@lists.geany.org