Repository: GraphiteEditor/Graphite (language: rust)

Issue:
When editing text in the viewport, hitting Escape seems to delete all the text
When editing text using the text tool, in the viewport, pressing Escape seems to delete the text and the text disappears.
Desired behavior is for the Escape button to function the same as rmb when using the text tool.

[Discord thread here.](https://discord.com/channels/731730685944922173/1288982713176690689)





Discussion / hints:

Fix patch:
diff --git a/editor/src/messages/input_mapper/input_mappings.rs b/editor/src/messages/input_mapper/input_mappings.rs
index bccaadef53..5b2c759aeb 100644
--- a/editor/src/messages/input_mapper/input_mappings.rs
+++ b/editor/src/messages/input_mapper/input_mappings.rs
@@ -151,7 +151,7 @@ pub fn input_mappings() -> Mapping {
 		//
 		// TextToolMessage
 		entry!(KeyUp(MouseLeft); action_dispatch=TextToolMessage::Interact),
-		entry!(KeyDown(Escape); action_dispatch=TextToolMessage::Abort),
+		entry!(KeyDown(Escape); action_dispatch=TextToolMessage::CommitText),
 		entry!(KeyDown(Enter); modifiers=[Accel], action_dispatch=TextToolMessage::CommitText),
 		//
 		// GradientToolMessage
diff --git a/editor/src/messages/tool/tool_messages/text_tool.rs b/editor/src/messages/tool/tool_messages/text_tool.rs
index 207b74d829..748b428ca7 100644
--- a/editor/src/messages/tool/tool_messages/text_tool.rs
+++ b/editor/src/messages/tool/tool_messages/text_tool.rs
@@ -496,10 +496,10 @@ impl Fsm for TextToolFsmState {
 				HintGroup(vec![HintInfo::mouse(MouseMotion::Lmb, "Place Text")]),
 				HintGroup(vec![HintInfo::mouse(MouseMotion::Lmb, "Edit Text")]),
 			]),
-			TextToolFsmState::Editing => HintData(vec![
-				HintGroup(vec![HintInfo::keys([Key::Escape], "Discard Changes")]),
-				HintGroup(vec![HintInfo::keys([Key::Control, Key::Enter], "Commit Changes").add_mac_keys([Key::Command, Key::Enter])]),
-			]),
+			TextToolFsmState::Editing => HintData(vec![HintGroup(vec![
+				HintInfo::keys([Key::Control, Key::Enter], "").add_mac_keys([Key::Command, Key::Enter]),
+				HintInfo::keys([Key::Escape], "Commit Changes").prepend_slash(),
+			])]),
 		};
 
 		responses.add(FrontendMessage::UpdateInputHints { hint_data });


Test patch: