From cde13db5b138abcac3b4c4fa5ae08adcb008d350 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Wed, 3 Mar 2021 21:43:38 +0100 Subject: [PATCH] Replace every backslash after user finished typing --- src/main/java/edu/kit/typicalc/view/main/InputBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/edu/kit/typicalc/view/main/InputBar.java b/src/main/java/edu/kit/typicalc/view/main/InputBar.java index 76ba915..b43343c 100644 --- a/src/main/java/edu/kit/typicalc/view/main/InputBar.java +++ b/src/main/java/edu/kit/typicalc/view/main/InputBar.java @@ -67,7 +67,7 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver { + "if (area.value.indexOf('\\\\') >= 0) {" + " var start = area.selectionStart;" + " var end = area.selectionEnd;" - + " area.value = area.value.replace('\\\\', 'λ');" + + " area.value = area.value.replaceAll('\\\\', 'λ');" + " area.selectionStart = start;" + " area.selectionEnd = end;" + "}});");