Skip to content

Commit

Permalink
Bugfix: Replace line break with space in single line code inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
LaCuneta committed May 28, 2024
1 parent bdf9c32 commit dc8ed61
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ RactiveCodeContainerOneLine = RactiveCodeContainerBase.extend({
@._super()
forceOneLine =
(_, change) ->
oneLineText = change.text.join('').replace(/\n/g, '')
lines = if change.text[change.text.length - 1] is ''
change.text.slice(0, change.text.length - 1)
else
change.text
oneLineText = lines.join(' ')
change.update(change.from, change.to, [oneLineText])
true
@_editor.on('beforeChange', forceOneLine)
Expand Down

0 comments on commit dc8ed61

Please sign in to comment.