Bug 508323 - CompletionProposalPopup does not trigger on Shift+Enter nor Ctrl+Enter on Linux when the pop-up has focus.
Summary: CompletionProposalPopup does not trigger on Shift+Enter nor Ctrl+Enter on Lin...
Status: CLOSED DUPLICATE of bug 508245
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows NT
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-28 13:19 EST by Fabio Zadrozny CLA
Modified: 2016-12-12 14:54 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Zadrozny CLA 2016-11-28 13:19:24 EST
This happens because in org.eclipse.jface.text.contentassist.CompletionProposalPopup.createProposalSelector(), the behavior of:

fProposalTable.addSelectionListener(new SelectionListener() {

	@Override
	public void widgetSelected(SelectionEvent e) {}

	@Override
	public void widgetDefaultSelected(SelectionEvent e) {
		insertSelectedProposalWithMask(e.stateMask);
	}
});


is OS-specific (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=508245).

As on CompletionProposalPopup.verifyKey(), it checks for '\r', '\n' and passes along the event.stateMask, I think that the behavior should be the same when the pop-up has a focus (the reason why this is problematic for PyDev is explained in https://bugs.eclipse.org/bugs/show_bug.cgi?id=508245), so, my suggestion is changing the code to handle a KeyDown event and checking for '\r', '\n', as it does on the verifyEvent so that the same reasoning can be used whether the pop-up has focus or not... will provide a pull request for that -- unless someone sees this as a bad approach ;)
Comment 1 Markus Keller CLA 2016-12-12 13:45:05 EST

*** This bug has been marked as a duplicate of bug 287580 ***
Comment 2 Fabio Zadrozny CLA 2016-12-12 13:50:34 EST
Hi Markus, thank you for marking as a duplicate, still, that other bug doesn't seem to be the same thing (i.e.: On Windows the Ctrl/Shift is actually passed along, so, it's not the cause of the other bug reported in JDT).

So, I'm reopening this bug (as the fix on this bug will *not* fix the issue reported at JDT related to the 'Ctrl' toggle override)... 

As a note, I have the intention of providing a fix for this one when I have time (but as I said, it won't fix that other issue as it's actually unrelated).
Comment 3 Markus Keller CLA 2016-12-12 14:54:07 EST
You're right it's not really a dup of bug 287580. 

Note that I posted bug 508245 comment 9 and reopened that bug. The missing event on GTK is an SWT bug that needs to be fixed there. That fix will make this request obsolete, so I'm closing it as a dup of that bug.

*** This bug has been marked as a duplicate of bug 508245 ***