diff options
| author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-09 23:12:30 +0100 | 
|---|---|---|
| committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-09 23:12:30 +0100 | 
| commit | 20d1f0e1e8cddf461494e8933eda808a465cb542 (patch) | |
| tree | b28603d76a9a7e49690181e6ec966269af7f9f73 /src/spawn.cpp | |
| parent | fa128671e2c4115f79200e69bde21a1bd484cad9 (diff) | |
allow "-EC" command even though we do not generally imply the sign prefix
Diffstat (limited to 'src/spawn.cpp')
| -rw-r--r-- | src/spawn.cpp | 16 | 
1 files changed, 13 insertions, 3 deletions
| diff --git a/src/spawn.cpp b/src/spawn.cpp index d34f8f5..c63a6c1 100644 --- a/src/spawn.cpp +++ b/src/spawn.cpp @@ -75,9 +75,11 @@ parse_shell_command_line(const gchar *cmdline, GError **error)  /*$   * EC[command]$ -- Execute operating system command and filter buffer contents   * linesEC[command]$ + * -EC[command]$   * from,toEC[command]$   * :EC[command]$ -> Success|Failure   * lines:EC[command]$ -> Success|Failure + * -:EC[command]$ -> Success|Failure   * from,to:EC[command]$ -> Success|Failure   *   * The EC command allows you to interface with the operating @@ -101,6 +103,7 @@ parse_shell_command_line(const gchar *cmdline, GError **error)   * of <lines> are piped from the buffer into the program and   * its output replaces these <lines>.   * This effectively runs <command> as a filter over <lines>. + * \(lq-EC\(rq may be written as a short-cut for \(lq-1EC\(rq.   * When invoked with two parameters, the characters beginning   * at position <from> up to the character at position <to>   * are piped into the program and replaced with its output. @@ -187,9 +190,12 @@ StateExecuteCommand::initial(void)  	 */  	switch (expressions.args()) {  	case 0: -		/* pipe nothing, insert at dot */ -		ctx.from = ctx.to = interface.ssm(SCI_GETCURRENTPOS); -		break; +		if (expressions.num_sign > 0) { +			/* pipe nothing, insert at dot */ +			ctx.from = ctx.to = interface.ssm(SCI_GETCURRENTPOS); +			break; +		} +		/* fall through if prefix sign is "-" */  	case 1: {  		/* pipe and replace line range */ @@ -362,9 +368,11 @@ gerror:  /*$   * EGq[command]$ -- Set Q-Register to output of operating system command   * linesEGq[command]$ + * -EGq[command]$   * from,toEGq[command]$   * :EGq[command]$ -> Success|Failure   * lines:EGq[command]$ -> Success|Failure + * -:EGq[command]$ -> Success|Failure   * from,to:EGq[command]$ -> Success|Failure   *   * Runs an operating system <command> and set Q-Register @@ -378,6 +386,8 @@ gerror:   * the current buffer position and writing process output   * to the Q-Register <q>.   * In other words, the current buffer is not modified by EG. + * + * The register <q> is defined if it does not already exist.   */  State *  StateEGCommand::got_register(QRegister ®) | 
