Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 538981

Summary: Ctrl+Backspace on Quick Access box doesn't work if editor active
Product: [Eclipse Project] Platform Reporter: Nobody - feel free to take it <nobody>
Component: SWTAssignee: Xi Yan <xixiyan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mistria
Version: 4.8   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=346390
https://bugs.eclipse.org/bugs/show_bug.cgi?id=500818
Whiteboard:

Description Nobody - feel free to take it CLA 2018-09-12 09:10:24 EDT
To reproduce:

- open a Java file in a normal Eclipse editor with a blinking caret
- press Ctrl+3 to focus the quick access box
- type something there e.g. 'create'
- press Ctrl+Backspace and observe that the word deletion happens in the java editor rather in the quick access box you just typed
Comment 1 Xi Yan CLA 2018-09-13 16:38:59 EDT
The issue here is that the command for deleting a word in the text editor is bind to Ctrl+Backspace. The key bindings overwrites any default shortcut for the SWT widgets. 

To see this: 

1) Open Preferences->General->Keys, search for Delete Previous Word command
2) Unbind the command
3) Open with a file generic text editor (not a java editor)
3) Now word deletion with Ctrl+Backspace should work as expected

However, unbinding the command also prevents us from deleting a word using Ctrl+Backspace in the Java editor because the ST.DELETE_PREVIOUS_WORD action is handled by JDT instead of the default handler in StyledText. See org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.createNavigationActions(CompilationUnitEditor.java:1846) where the default StyledText handler was disabled. Ctrl+Backspace does not work with a java editor if the we unbind the command. 

The same issue happens with all key bindings, i.e. Ctrl++ when quick access box is in focus triggers zoom in, etc. 

One possible solution is a similar fix to bug 346390. 

1) SWT need to have an API for Text to delete previous word
2) In org.eclipse.ui.internal.quickaccess.SearchField#hookUpSelectAll, override the Delete Previous Word command with a handler that executes the deletePreviousWord on txtQuickAccess explicitly
Comment 2 Mickael Istria CLA 2019-05-14 07:48:23 EDT
This is similar to bug 500818 where I didn't manage to bind the F2 key to the Quick Access action only because the F2 from editor takes precedence.
Comment 3 Alexander Kurtakov CLA 2020-01-23 18:13:12 EST
This has been fixed with the change of Ctrl+3 becoming dialog.