| Summary: | Staging View commit message area gets easily corrupted when hard wrap is switched on | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Technology] EGit | Reporter: | Stefan Lay <stefan.lay> | ||||
| Component: | UI | Assignee: | Project Inbox <egit.ui-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | critical | ||||||
| Priority: | P3 | CC: | markus.kell.r, matthias.sohn, robin | ||||
| Version: | 3.3 | ||||||
| Target Milestone: | 3.3 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 426009 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Stefan Lay
Confirmed. I suspect this might be a bug in StyledText's BidiSegmentListener support in conjunction with SWT.H_SCROLL. @Markus: Do you know of such a bug? The code using this is in EGit's SpellcheckableMessageArea. See also bug 424846, which is about making this configurable. The quickest fix would be to revert the commit which changed SWT.WRAP to SWT.H_SCROLL. Created attachment 239072 [details] Fix hard-wrap by enabling soft-wrap The problem is that the StyledText implementation skips all support for intra-line wrapping unless the widget is created with SWT.WRAP (or setWordWrap(true) is called). But a segment listener that inserts line breaks needs the wrapping support; just not the auto-wrapping at a certain line width. A quick workaround is to call setWordWrap(true) in EGit's hard-wrap mode, see the attached patch. Drawbacks: - If the message area is too narrow, then you also get real soft-wraps (like in older EGit versions) - StyledText always shows a horizontal scroll bar (bug 425907, fixed in master) I'll see if the StyledText could be convinced to perform intra-line wrapping as soon as a segment listener inserts a line break. (In reply to Markus Keller from comment #2) > Created attachment 239072 [details] [diff] > Fix hard-wrap by enabling soft-wrap This contribution complies with http://www.eclipse.org/legal/CoO.php (In reply to Markus Keller from comment #2) > I'll see if the StyledText could be convinced to perform intra-line wrapping > as soon as a segment listener inserts a line break. I've fixed StyledText bug 426009 in master, so this bug will disappear in 4.4. The workaround from comment 2 is necessary for SWT < 4.4. (In reply to Robin Stocker from comment #1) > See also bug 424846, which is about making this configurable. The quickest > fix would be to revert the commit which changed SWT.WRAP to SWT.H_SCROLL. That would also be a good solution ;-) http://git.eclipse.org/c/egit/egit.git/commit/?id=3c58e4ed5ec994307ffb20fb78ec2269e04ce392 should be reverted until EGit requires SWT 4.4. I don't see a way to make this work without the recent fixes in StyledText. (In reply to Markus Keller from comment #5) > http://git.eclipse.org/c/egit/egit.git/commit/ > ?id=3c58e4ed5ec994307ffb20fb78ec2269e04ce392 should be reverted until EGit > requires SWT 4.4. I don't see a way to make this work without the recent > fixes in StyledText. pushed revert for review https://git.eclipse.org/r/#/c/21077/ (In reply to Matthias Sohn from comment #6) > pushed revert for review > https://git.eclipse.org/r/#/c/21077/ Merged: https://git.eclipse.org/c/egit/egit.git/commit/?id=16c186fe543f8d9a45c64f066c6f00230581595a I think the `setAlwaysShowScrollBars(false)` part of the original patch was ok, so here's a change to reintroduce just that: https://git.eclipse.org/r/21080 @Markus Keller: Thanks very much for your help and the platform fixes! (In reply to Robin Stocker from comment #7) > I think the `setAlwaysShowScrollBars(false)` part of the original patch was > ok, so here's a change to reintroduce just that: > > https://git.eclipse.org/r/21080 Merged by Matthias: https://git.eclipse.org/c/egit/egit.git/commit/?id=8b3603ac60fe1e9cfdf906ffc11134cd36610b12 |