sublime-text-shell-command icon indicating copy to clipboard operation
sublime-text-shell-command copied to clipboard

the output is added to the end of the file

Open jabbalaci opened this issue 6 years ago • 1 comments

Say I want to sort these lines:

bb                                                                                                                                                                        
dd    
cc    
aa

In Vim it works like this: select the four lines, press "!", type "sort", Enter, and the four selected lines are replaced by the sorted result.

I want to redo this with this plugin. I have this at the moment:

    {
	    "keys": ["ctrl+enter"],
	    "command": "shell_command",
	    "args": {
	      "prompt": "shell command: ",
	      "region": "stdin",
	      "target": "point"
	    }
    }

I select the four lines, press Ctrl + Enter, type in "sort", Enter, and the problem is this: the sorted result is appended to the end of the file. What I want: overwrite the selected four unsorted lines. Is it possible? How?

jabbalaci avatar Mar 15 '19 18:03 jabbalaci

Also getting this behavior, any output echoed by the script is appended to the end of the file, not inserted where the cursor is located.

{  	
    "keys": ["f8"],
    "command": "shell_command",
    "args": {
	  "title": "Elapsed Time",
      "command": "~/bin/elapsed",      
      "target": "point"
    }
  }

ntroutman avatar Aug 26 '19 15:08 ntroutman