Skip to content

Commit

Permalink
Fix auto-spacing incorrectly triggered (florisboard#1947)
Browse files Browse the repository at this point in the history
Issue only occurred for non-Appender composers
  • Loading branch information
patrickgold authored and snaik20 committed Oct 8, 2022
1 parent d6198da commit 11ec1a6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ abstract class AbstractEditorInstance(context: Context) {
val composer = determineComposer(subtypeManager.activeSubtype.composer)
val previous = content.textBeforeSelection.takeLast(composer.toRead.coerceAtLeast(if (deletePreviousSpace) 1 else 0))
val (tempRm, tempText) = composer.getActions(previous, char[0])
val rm = if (previous.isNotEmpty() && previous.last() == ' ') tempRm + 1 else tempRm
val rm = if (deletePreviousSpace && previous.isNotEmpty() && previous.last() == ' ') tempRm + 1 else tempRm
val finalText = buildString(tempText.length + 2) {
if (insertSpaceBeforeChar) append(' ')
append(tempText)
Expand Down

0 comments on commit 11ec1a6

Please sign in to comment.