| Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
|
|
If no address is provided these commands no longer apply to the whole
line, but instead will insert the output of the external program
at the current cursor location.
|
|
Close #220
|
|
|
|
|
|
|
|
|
|
|
|
This should fix a segfault when using :q while multiple selections
are active.
|
|
The end range should still be respected, previously it would continue
looping for all lines until the end of file.
|
|
|
|
|
|
If only line numbers are given (either in absolute or relative form)
we treat it as motion instead of a range specifier. That is :nn moves
to line nn, but does not select it.
This should however not affect other range specifiers such as :n,m
|
|
For commands like :q the view might already have been freed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following vi commands have been dropped:
- saveas
- xit
- !
The following commands are only recognized in their short form:
- e (edit)
- q (quit)
- s (substitute)
- w (write)
- r (read)
|
|
|
|
Eventually this should be rewritten as an internal command.
|
|
|
|
The following should now work:
:sam x/^static/ .,+/^\}/ { i/<</ a/>>/ }
|
|
These commands can be followed by an address which changes the
range to which the sub command applies. The looping construct
should then continue at the position of the last change within
the original range.
A previously problemeatic example:
:sam x/^static/ .,+/^\}/ c/replaced
|
|
|
|
It replaces current range with the file content. However in the common
case the range is actually defaults to the whole file which is probably
not what is expected.
|
|
|
|
|
|
|
|
|
|
|
|
Add infrastructure to handle commands which take file names,
shell commands or general white space delimited parameters
as arguments.
|
|
That is something like :sam +5 or :sam 10 will move to the start
of the selected line instead of selecting the whole line.
TODO: due to the current implementation it will also affect
:sam x/pattern/-10+10
|
|
Because duplicated cursors are no longer allowed we have to
remove the old cursors before, not after executing the sam
command. Otherwise commands like g/foo/ which re-create the
same selection fail.
|
|
|
|
|
|
This should fix -0+,+0-
|
|
Only create a selection (and switch to visual mode) if at least one
print command was given a non-empty range. Also reject invalid ranges.
This allows cursor movements with thinks like #10
|
|
This fixes x/^.*$/i/FOO
|
|
This fixes y/\n/i/FOO
|
|
In a command like ,x/pattern the comma should default to the whole file.
|
|
|
|
|
|
For those not familiar with sam(1) more information can be found at
http://sam.cat-v.org/
For now sam commands can be entered from the vis prompt via :sam <cmd>
A command behaves differently depending on the mode in which it is issued:
- in visual mode it behaves as if an implicit extract x command
matching the current selection(s) would be preceding it. That is
the command is executed once for each selection.
- in normal mode:
* if an address for the command was provided it is evaluated starting
from the current cursor position(s) i.e. dot is set to the current
cursor position.
* if no address was supplied to the command then:
+ if multiple cursors exist, the command is executed once for every
cursor with dot set to the current line of the cursor
+ otherwise if there is only 1 cursor then the command is executed
with dot set to the whole file
The command syntax was slightly tweaked to accpet more terse commands.
- When specifiying text or regular expressions the trailing delimiter can
be elided if the meaning is unambigious.
- If only an address is provided the print command will be executed.
- The print command creates a selection matching its range.
- In text entry \t inserts a literal tab character (sam only recognizes \n).
Hence the sam command ,x/pattern/ can be abbreviated to x/pattern
If a command is successful vis switches to normal mode (and hence removes
any selections), otherwise the editor is kept in visual mode. The print
command "fails" by definition.
|