Commit 2e7c295f authored by Sarah Grebing's avatar Sarah Grebing

Added shprtcut for handling terms, now git the whole Java bug

parent 88addd0e
Pipeline #22193 passed with stages
in 5 minutes and 27 seconds
...@@ -66,6 +66,7 @@ import org.reactfx.util.Timer; ...@@ -66,6 +66,7 @@ import org.reactfx.util.Timer;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.swing.*; import javax.swing.*;
import java.awt.im.InputContext;
import java.io.File; import java.io.File;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
...@@ -277,6 +278,7 @@ public class DebuggerMain implements Initializable { ...@@ -277,6 +278,7 @@ public class DebuggerMain implements Initializable {
ImmutableList<Goal> openGoals = p.getSubtreeGoals(p.root()); ImmutableList<Goal> openGoals = p.getSubtreeGoals(p.root());
KeyData kd = new KeyData(openGoals.get(0), env, p); KeyData kd = new KeyData(openGoals.get(0), env, p);
scriptController.getAutoCompleter().getArgumentCompleter().setDefaultKeyData(kd); scriptController.getAutoCompleter().getArgumentCompleter().setDefaultKeyData(kd);
}; };
getFacade().environmentProperty().addListener(invalidationListener); getFacade().environmentProperty().addListener(invalidationListener);
getFacade().proofProperty().addListener(invalidationListener); getFacade().proofProperty().addListener(invalidationListener);
...@@ -676,8 +678,8 @@ public class DebuggerMain implements Initializable { ...@@ -676,8 +678,8 @@ public class DebuggerMain implements Initializable {
private void onInterpreterError(DebuggerFramework<KeyData> keyDataDebuggerFramework, Throwable throwable) { private void onInterpreterError(DebuggerFramework<KeyData> keyDataDebuggerFramework, Throwable throwable) {
Platform.runLater(() -> { Platform.runLater(() -> {
Utils.showExceptionDialog("Error during Execution", "Error during Script Execution", Utils.showExceptionDialog("An error has occurred during execution.", "Error during Script Execution",
"Here should be some really good text...\nNothing will be the same. Everything broken.", "Please reload the problem to get a consistent proof state.",
throwable throwable
); );
}); });
......
...@@ -34,6 +34,7 @@ import javafx.scene.Node; ...@@ -34,6 +34,7 @@ import javafx.scene.Node;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.input.*; import javafx.scene.input.*;
import static javafx.scene.input.KeyCombination.CONTROL_ANY;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import javafx.scene.paint.Color; import javafx.scene.paint.Color;
import javafx.scene.paint.Paint; import javafx.scene.paint.Paint;
...@@ -141,6 +142,7 @@ public class ScriptArea extends BorderPane { ...@@ -141,6 +142,7 @@ public class ScriptArea extends BorderPane {
private void init() { private void init() {
codeArea.setAutoScrollOnDragDesired(false); codeArea.setAutoScrollOnDragDesired(false);
InputMap<KeyEvent> inputMap = sequence( InputMap<KeyEvent> inputMap = sequence(
process(EventPattern.keyPressed(), process(EventPattern.keyPressed(),
(e) -> { (e) -> {
...@@ -148,6 +150,8 @@ public class ScriptArea extends BorderPane { ...@@ -148,6 +150,8 @@ public class ScriptArea extends BorderPane {
inlineToolbar.hide(); inlineToolbar.hide();
return PROCEED; return PROCEED;
}), }),
consume(keyPressed(new KeyCodeCombination(KeyCode.E, KeyCombination.CONTROL_DOWN))
, (e) -> addBackticks()),
consumeWhen(keyPressed(KeyCode.ENTER), autoCompletion::isVisible, consumeWhen(keyPressed(KeyCode.ENTER), autoCompletion::isVisible,
e -> autoCompletion.complete()), e -> autoCompletion.complete()),
consume(keyPressed(KeyCode.ENTER, SHORTCUT_DOWN), consume(keyPressed(KeyCode.ENTER, SHORTCUT_DOWN),
...@@ -241,6 +245,7 @@ public class ScriptArea extends BorderPane { ...@@ -241,6 +245,7 @@ public class ScriptArea extends BorderPane {
//this.moveTo(characterPosition, NavigationActions.SelectionPolicy.CLEAR); //this.moveTo(characterPosition, NavigationActions.SelectionPolicy.CLEAR);
}); });
mainScript.addListener((observable) -> updateMainScriptMarker()); mainScript.addListener((observable) -> updateMainScriptMarker());
filePath.addListener((p, o, n) -> { filePath.addListener((p, o, n) -> {
if (o != null) if (o != null)
...@@ -357,6 +362,14 @@ public class ScriptArea extends BorderPane { ...@@ -357,6 +362,14 @@ public class ScriptArea extends BorderPane {
} }
private void addBackticks(){
int pos = codeArea.getCaretPosition();
insertText(pos, "``");
codeArea.displaceCaret(pos+1);
}
private void highlightProblems() { private void highlightProblems() {
LinterStrategy ls = LinterStrategy.getDefaultLinter(); LinterStrategy ls = LinterStrategy.getDefaultLinter();
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment