Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,9 @@ private function textFormatSelection pText
put pText into tTextLines
split tTextLines by return

local tLastCharIsReturn
put (char -1 of pText is return) into tLastCharIsReturn

get textFormatLine(1, tTextLines, tPreviousLine)
put firstWordToEnd(tTextLines[1]) into tTextLines[1]
put tTextLines[1] into tResult
Expand All @@ -700,6 +703,10 @@ private function textFormatSelection pText
put return & tTextLines[tIndex] after tResult
end repeat

if char -1 of tResult is not return and tLastCharIsReturn then
put return after tResult
end if

if line -1 of pText = "" then put cr after tResult

return tResult
Expand Down
1 change: 1 addition & 0 deletions notes/bugfix-22636.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Assure textFormatSelection preserves returns at end of text