File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
src/main/java/com/devoxx/genie/ui/component/input Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,13 @@ public void keyPressed(@NotNull KeyEvent e) {
108108 newlineShortcutString = stateService .getNewlineShortcutWindows ();
109109 }
110110
111+ if (submitShortcutString == null || submitShortcutString .isEmpty ()) {
112+ submitShortcutString = "shift ENTER" ;
113+ }
114+ if (newlineShortcutString == null || newlineShortcutString .isEmpty ()) {
115+ newlineShortcutString = SystemInfo .isMac ? "meta ENTER" : "ctrl ENTER" ;
116+ }
117+
111118 KeyStroke submitKeyStroke = KeyStroke .getKeyStroke (submitShortcutString );
112119 KeyStroke newlineKeyStroke = KeyStroke .getKeyStroke (newlineShortcutString );
113120
Original file line number Diff line number Diff line change @@ -142,6 +142,9 @@ public void setFileSelectionCallback(Runnable fileSelectionCallback) {
142142 }
143143
144144 private void setPlaceholderWithKeyboardShortcut (String shortcut ) {
145+ if (shortcut == null || shortcut .isEmpty ()) {
146+ shortcut = "shift Enter" ;
147+ }
145148 // Clean up the shortcut text
146149 shortcut = shortcut .replace ("pressed" , "+" )
147150 .replace ("meta" , "command" );
@@ -161,6 +164,10 @@ private void setPlaceholderWithKeyboardShortcut(String shortcut) {
161164 } else {
162165 newlineShortcut = DevoxxGenieStateService .getInstance ().getNewlineShortcutMac ();
163166 }
167+
168+ if (newlineShortcut == null || newlineShortcut .isEmpty ()) {
169+ newlineShortcut = SystemInfo .isMac ? "meta Enter" : "ctrl Enter" ;
170+ }
164171
165172 // Format the newline shortcut text
166173 newlineShortcut = newlineShortcut .replace ("pressed" , "+" )
You can’t perform that action at this time.
0 commit comments