Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 179023 Details for
Bug 324838
Uncommenting with empty lines works unexpectedly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
workaround until platform bug is fixed.
324838.txt (text/plain), 3.02 KB, created by
Markus Schorn
on 2010-09-16 07:36:12 EDT
(
hide
)
Description:
workaround until platform bug is fixed.
Filename:
MIME Type:
Creator:
Markus Schorn
Created:
2010-09-16 07:36:12 EDT
Size:
3.02 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.ui >Index: src/org/eclipse/cdt/internal/ui/editor/ToggleCommentAction.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ToggleCommentAction.java,v >retrieving revision 1.14 >diff -u -r1.14 ToggleCommentAction.java >--- src/org/eclipse/cdt/internal/ui/editor/ToggleCommentAction.java 2 Jun 2010 19:10:19 -0000 1.14 >+++ src/org/eclipse/cdt/internal/ui/editor/ToggleCommentAction.java 16 Sep 2010 11:35:29 -0000 >@@ -24,6 +24,7 @@ > import org.eclipse.jface.text.ITypedRegion; > import org.eclipse.jface.text.Region; > import org.eclipse.jface.text.TextUtilities; >+import org.eclipse.jface.text.TextViewer; > import org.eclipse.jface.text.source.ISourceViewer; > import org.eclipse.jface.text.source.SourceViewerConfiguration; > import org.eclipse.jface.viewers.ISelection; >@@ -173,16 +174,25 @@ > * Creates a region describing the text block (something that starts at > * the beginning of a line) completely containing the current selection. > * >+ * Note, the implementation has to match {@link TextViewer}.getTextBlockFromSelection(). >+ * > * @param selection The selection to use > * @param document The document > * @return the region describing the text block comprising the given selection > */ > private IRegion getTextBlockFromSelection(ITextSelection selection, IDocument document) { > try { >- IRegion line= document.getLineInformationOfOffset(selection.getOffset()); >- int length= selection.getLength() == 0 ? >- line.getLength() : selection.getLength() + (selection.getOffset() - line.getOffset()); >- return new Region(line.getOffset(), length); >+ // Until https://bugs.eclipse.org/bugs/show_bug.cgi?id=325438 is fixed, work around it >+ int start= document.getLineOffset(selection.getStartLine()); >+ int endLine= selection.getEndLine(); >+ IRegion endLineInfo= document.getLineInformation(endLine); >+ int end= endLineInfo.getOffset() + endLineInfo.getLength(); >+ return new Region(start, end - start); >+ >+// IRegion line= document.getLineInformationOfOffset(selection.getOffset()); >+// int length= selection.getLength() == 0 ? >+// line.getLength() : selection.getLength() + (selection.getOffset() - line.getOffset()); >+// return new Region(line.getOffset(), length); > > } catch (BadLocationException e) { > CUIPlugin.log(e); // Should not happen >@@ -298,13 +308,12 @@ > > String[] types= configuration.getConfiguredContentTypes(sourceViewer); > Map<String, String[]> prefixesMap= new HashMap<String, String[]>(types.length); >- for (int i= 0; i < types.length; i++) { >- String type= types[i]; >+ for (String type : types) { > String[] prefixes= configuration.getDefaultPrefixes(sourceViewer, type); > if (prefixes != null && prefixes.length > 0) { > int emptyPrefixes= 0; >- for (int j= 0; j < prefixes.length; j++) { >- if (prefixes[j].length() == 0) >+ for (String prefixe : prefixes) { >+ if (prefixe.length() == 0) > emptyPrefixes++; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mschorn.eclipse
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 324838
: 179023