Add support for special character arguments
This commit is contained in:
parent
ebf31012dc
commit
3de7653f2d
1 changed files with 5 additions and 1 deletions
|
|
@ -468,7 +468,7 @@ class Ex
|
||||||
move: ({range, args, editor}) ->
|
move: ({range, args, editor}) ->
|
||||||
args = args.trimLeft()
|
args = args.trimLeft()
|
||||||
lastLine = editor.getLastScreenRow()
|
lastLine = editor.getLastScreenRow()
|
||||||
argsPattern = /[+-]\d+|\d+|[+-]/g
|
argsPattern = /^[$.]|[+-]\d+|\d+|[+-]/g
|
||||||
args = args.match(argsPattern)
|
args = args.match(argsPattern)
|
||||||
|
|
||||||
if args?
|
if args?
|
||||||
|
|
@ -476,6 +476,10 @@ class Ex
|
||||||
address = if firstArgIsOffset then range[0] else 0
|
address = if firstArgIsOffset then range[0] else 0
|
||||||
|
|
||||||
for arg in args
|
for arg in args
|
||||||
|
if arg == '$'
|
||||||
|
address = lastLine
|
||||||
|
else if arg == '.'
|
||||||
|
address = editor.getCursorBufferPosition().row + 1
|
||||||
else if arg == '+'
|
else if arg == '+'
|
||||||
address++
|
address++
|
||||||
else if arg == '-'
|
else if arg == '-'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue