From feed89257ff7429c54e6159ccbf33cbe329d29eb Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 18 Apr 2017 00:45:38 +0200 Subject: [PATCH] Fix indexing bug with using an accidental :: prefix in EvEditor, fix function of the ::: editor command. --- evennia/utils/eveditor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/utils/eveditor.py b/evennia/utils/eveditor.py index ec0a825b18..d04582c328 100644 --- a/evennia/utils/eveditor.py +++ b/evennia/utils/eveditor.py @@ -275,7 +275,7 @@ class CmdEditorBase(Command): lstart, lend = cline, cline + 1 linerange = False - if arglist and ':' in arglist[0]: + if arglist and arglist[0].count(':') == 1: part1, part2 = arglist[0].split(':') if part1 and part1.isdigit(): lstart = min(max(0, int(part1)) - 1, nlines) @@ -426,7 +426,7 @@ class CmdEditorGroup(CmdEditorBase): editor.display_buffer(linenums=False, options={"raw": True}) elif cmd == ":::": # Insert single colon alone on a line - editor.update_buffer(editor.buffer + "\n:") + editor.update_buffer([":"] if lstart == 0 else linebuffer + [":"]) if echo_mode: caller.msg("Single ':' added to buffer.") elif cmd == ":h":