eclipse.platform.swt icon indicating copy to clipboard operation
eclipse.platform.swt copied to clipboard

Ctrl+backspace doesn't honor CamelCase in StyledText

Open akurtakov opened this issue 2 years ago • 6 comments

E.g. if cursor is at CamelCase| and one hits Ctrl+bksp the whole word is deleted while only Case should be removed (aka Camel| left)

akurtakov avatar Oct 04 '23 13:10 akurtakov

Command is org.eclipse.ui.edit.text.deletePreviousWord, it then goes to StyledText.getWordPrevious() which in turned create an event handled by a MovementListener, which for the generic editor seems to be org.eclipse.jface.text.TextViewer$TextDoubleClickStrategyConnector.

mickaelistria avatar Oct 10 '23 15:10 mickaelistria

Actually the MovementListener is a no-op here, but surprisingly, the word limits are decided natively by Pango, in TextLayout._getOffset(). One benefit is that the implementation here matches the native one (I verified and the behavior is the same on Firefox than in Eclipse IDE for Ctrl+Left/Right).

mickaelistria avatar Oct 10 '23 15:10 mickaelistria

Hi @akurtakov @mickaelistria I have tried to check SWT Snippet213, below apps and they also do the same i mean "deleting the whole word when control+backspace is pressed when cursor is at the end of a camel case word say DeepikaUdayagiri".

  • Notepad++
  • Ms word
  • Search on windows 11 taskbar So for me looks like StyledText is behaving in the similar lines as these native applications, so i feel this is not an issue.

deepika-u avatar Jan 23 '24 14:01 deepika-u

@deepika-u If one uses JDT's Java editor the behavior is as I described but I I agree that it's a very fine line where exactly the bug lies without further investigation.

akurtakov avatar Jan 23 '24 15:01 akurtakov

@akurtakov SWT is working at par with native applications so i dont think its an swt issue. Should i move to JDT.ui?

deepika-u avatar Jan 24 '24 08:01 deepika-u

It's most likely a Generic Editor issue aka Platform UI.

akurtakov avatar Jan 24 '24 08:01 akurtakov