Skip to content

Commit

Permalink
don't include trailing newlines when copying a line
Browse files Browse the repository at this point in the history
it causes artifacts when pasting that line in `gui/launcher`
or other edit boxes
  • Loading branch information
myk002 committed Aug 8, 2024
1 parent f198cc6 commit 35ca70b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/journal/text_editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 35ca70b

Please sign in to comment.