| Summary: | [typing] TextViewer.shift(...) does not shift last line, if it is empty. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Markus Schorn <mschorn.eclipse> | ||||||
| Component: | Text | Assignee: | Markus Schorn <mschorn.eclipse> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | aleherb+eclipse, daniel_megert | ||||||
| Version: | 3.6 | ||||||||
| Target Milestone: | 3.7 M3 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 324838 | ||||||||
| Attachments: |
|
||||||||
|
Description
Markus Schorn
Created attachment 179021 [details]
fix
Thanks for tracking this down Markus. The patch goes into the right direction though I don't like coding by exception too much. Can you please handle that case in regular code and also add your credentials to the copyright notice of the file in the following form: name <e-mail> - bugzilla summary - bugzilla URL e.g. Dani Megert <dani@eclipse.org> - this is a bug - https://bugs.eclipse.org... Thanks! Created attachment 179040 [details]
updated fix
The new patch no longer relies on a caught exception. In addition to that I have removed the outer catch clause in getTextBlockFromSelection(..), because returning 'null' would just trigger a NPE in the calling method, whereas the BadLocationException is handled there.
If you don't like it that way feel free to adjust my patch before applying it.
(In reply to comment #3) > In addition to that I > have removed the outer catch clause in getTextBlockFromSelection(..), because > returning 'null' would just trigger a NPE in the calling method, whereas the > BadLocationException is handled there. Good catch! Patch committed to HEAD. Available in builds > N20100917-2000. >Available in builds > N20100917-2000.
Available in builds >= N20100917-2000.
Thanks, I have verified the fix with the CDT editor using 3.7M3. |