Add support for special character arguments

This commit is contained in:
solecki 2018-04-15 00:52:47 +02:00
parent ebf31012dc
commit 3de7653f2d

View file

@ -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 == '-'