Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-text-dev] Add "delete previous word" and "delete next word" actions to eclipse editor

Tomasz,

Your patch locates this functionality at the SWT level. This is in sync with the navigation actions such as "position cursor after the next word". Like the navigation actions your implementation uses the StyledText internal methods to determine the start/end of a word. Those methods are based on white space detection and the distinction between letters and digits.

The StyledText is used to implement text editors. There is no assumption about the kind of text that can be edited in such editors. Take the Java editor as one example. A single Java compilation unit may contain Java code and comments. The StyledText methods are powerful enough for the Java code but not for the comments. This is because the contents of the comments is more or less natural language and the language defines the rules for the word boundaries. Thus, depending on the active locale, delete next/previous word potentially behaves differently in the code or comment sections of a single Java compilation unit. This should also be the case for the navigation actions and it is a lack in the text editor implementation that it does not.

A similar problem is the double click behavior of the Java editor. This actually is different in the code and the comment sections. In the code sections, it computes word boundaries simply by calls to the predicates defined in the class Character. In the comment sections, it detects word boundaries by instances of the class BreakIterator that it creates for the active locale.

Kai


At 07:39 PM 2/2/2003 +0100, you wrote:
Hi all,

I had been missing both above actions, so I implemented them based on v2.1
M4 source. The attachment with the code has been posted on Bugzilla along
the bug# 29027.

Tomasz

_______________________________________________
platform-text-dev mailing list
platform-text-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-text-dev



Back to the top