From 35ca70b2707ec2d535d8847135d1e3a8c05f6580 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 8 Aug 2024 16:10:39 -0700 Subject: [PATCH] don't include trailing newlines when copying a line it causes artifacts when pasting that line in `gui/launcher` or other edit boxes --- internal/journal/text_editor.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/journal/text_editor.lua b/internal/journal/text_editor.lua index 8bdd0aeb7..a0d650313 100644 --- a/internal/journal/text_editor.lua +++ b/internal/journal/text_editor.lua @@ -369,10 +369,7 @@ function TextEditorView:copy() local curr_line = self.text:sub( self:lineStartOffset(), self:lineEndOffset() - ) - if curr_line:sub(-1,-1) ~= NEWLINE then - curr_line = curr_line .. NEWLINE - end + ):match('^(.-)\n*$') self:setClipboard(curr_line)