Skip to content

Commit

Permalink
Always insert parentheses when calling a function using the pop-up ke…
Browse files Browse the repository at this point in the history
…yboard, and rewrite ln to log.
  • Loading branch information
fjwright committed Sep 13, 2020
1 parent 6fd6d7d commit 8a6c609
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,13 @@ Run-REDUCE-FX currently uses a bundled copy of
* Handle more of the non-standard TeX markup generated by fmprint.

### Updates since last release

* v1.91 Replace all KaTeX woff2 fonts with woff versions.
This fixes the big delimiters problem. I hope that WebView in a later
version of JavaFX will accept woff2 fonts and I can switch back.
* Add WebEngine debugging code from debugWebEngine branch.
* Add div margin styles to improve vertical spacing of typeset maths.
* Remove \> controls (tabs) from fmprint output, which don't seem to serve any
useful purpose, using katexMacros.
* Always insert parentheses when calling a function using the pop-up keyboard,
and rewrite ln to log.
16 changes: 10 additions & 6 deletions src/fjwright/runreduce/PopupKeyboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,19 +373,23 @@ private static void btmKbdButtonAction(MouseEvent mouseEvent, boolean trigHyp) {
// FixMe but can't do that from this static context!
} else
switch (text) {
case "ln":
text = "log";
break;
case "√‾":
text = "\u200C ";
text = "\u200C√";
break;
case "!":
text = "factorial";
break;
}
// Wrap selected text in target TextInputControl or
// insert text at caret if no text is selected:
// Wrap selected text in target TextInputControl or insert text
// followed by () at caret and backup if no text is selected:
final TextInputControl textInput = (TextInputControl) target;
if (textInput.getSelectedText().isEmpty())
textInput.insertText(textInput.getCaretPosition(), text);
else {
if (textInput.getSelectedText().isEmpty()) {
textInput.insertText(textInput.getCaretPosition(), text + "()");
textInput.backward();
} else {
final IndexRange selection = textInput.getSelection();
textInput.insertText(selection.getStart(), text + "(");
textInput.insertText(selection.getEnd() + text.length() + 1, ")");
Expand Down

0 comments on commit 8a6c609

Please sign in to comment.