Merge pull request #3459 from chiizujin/editor_echo

Fix editor echo not displaying correctly for lines with whitespace
This commit is contained in:
Griatch 2024-04-01 10:13:57 +02:00 committed by GitHub
commit 5c1d21696e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -414,7 +414,7 @@ class CmdLineInput(CmdEditorBase):
self.caller.msg("|b%02i|||n (|g%s|n) %s" % (cline, indent, raw(line)))
else:
self.caller.msg("|b%02i|||n %s" % (cline, raw(self.args)))
self.caller.msg("|b%02i|||n %s" % (cline, raw(line)))
class CmdEditorGroup(CmdEditorBase):

View file

@ -156,6 +156,13 @@ class TestEvEditor(BaseEvenniaCommandTest):
"First test line\nInserted-New Replaced Second line-End\n test line\n:",
)
self.call(
eveditor.CmdLineInput(),
" Whitespace echo test line.",
raw_string=" Whitespace echo test line.",
msg="05 Whitespace echo test line.",
)
def test_eveditor_COLON_UU(self):
eveditor.EvEditor(self.char1)
self.call(
@ -168,13 +175,13 @@ class TestEvEditor(BaseEvenniaCommandTest):
eveditor.CmdLineInput(),
'First test "line".',
raw_string='First test "line".',
msg='01First test "line" .',
msg='01First test "line".',
)
self.call(
eveditor.CmdLineInput(),
"Second 'line'.",
raw_string="Second 'line'.",
msg="02Second 'line' .",
msg="02Second 'line'.",
)
self.assertEqual(
self.char1.ndb._eveditor.get_buffer(), "First test \"line\".\nSecond 'line'."