Fix indexing bug with using an accidental :: prefix in EvEditor, fix function of the ::: editor command.
This commit is contained in:
parent
bc1f5f0fc9
commit
feed89257f
1 changed files with 2 additions and 2 deletions
|
|
@ -275,7 +275,7 @@ class CmdEditorBase(Command):
|
||||||
|
|
||||||
lstart, lend = cline, cline + 1
|
lstart, lend = cline, cline + 1
|
||||||
linerange = False
|
linerange = False
|
||||||
if arglist and ':' in arglist[0]:
|
if arglist and arglist[0].count(':') == 1:
|
||||||
part1, part2 = arglist[0].split(':')
|
part1, part2 = arglist[0].split(':')
|
||||||
if part1 and part1.isdigit():
|
if part1 and part1.isdigit():
|
||||||
lstart = min(max(0, int(part1)) - 1, nlines)
|
lstart = min(max(0, int(part1)) - 1, nlines)
|
||||||
|
|
@ -426,7 +426,7 @@ class CmdEditorGroup(CmdEditorBase):
|
||||||
editor.display_buffer(linenums=False, options={"raw": True})
|
editor.display_buffer(linenums=False, options={"raw": True})
|
||||||
elif cmd == ":::":
|
elif cmd == ":::":
|
||||||
# Insert single colon alone on a line
|
# Insert single colon alone on a line
|
||||||
editor.update_buffer(editor.buffer + "\n:")
|
editor.update_buffer([":"] if lstart == 0 else linebuffer + [":"])
|
||||||
if echo_mode:
|
if echo_mode:
|
||||||
caller.msg("Single ':' added to buffer.")
|
caller.msg("Single ':' added to buffer.")
|
||||||
elif cmd == ":h":
|
elif cmd == ":h":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue