diff options
author | Ron Yorston | 2021-04-15 12:06:51 +0100 |
---|---|---|
committer | Denys Vlasenko | 2021-04-15 13:09:12 +0200 |
commit | f2277268384d47fbcaba081f19cebc68de819836 (patch) | |
tree | adee727cf5f81119c1d93bd1e1c9981d095fd985 /libbb/xfuncs.c | |
parent | 47f78913f7576596d44c602a015735cb9c49f4f0 (diff) | |
download | busybox-f2277268384d47fbcaba081f19cebc68de819836.zip busybox-f2277268384d47fbcaba081f19cebc68de819836.tar.gz |
vi: allow line addresses to have an offset
Line addresses in colon commands can be defined using an expression
that includes '+' or '-' operators. The implementation follows
traditional vi:
- The first term in the expression defines an address. It can be
an absolute line number, '.', '$', a search or a marker.
- The second and subsequent terms must be non-negative integers.
- If the first term is missing '.' is assumed. If the operator is
missing addition is assumed. If the final term in missing an
offset of 1 is assumed.
Thus the following are valid addresses:
.+1 .+ + .1
.-1 .- -
The following are not valid (though they are in vim):
.+$ .$ 2+.
function old new delta
colon 3701 3844 +143
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 143/0) Total: 143 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/xfuncs.c')
0 files changed, 0 insertions, 0 deletions