Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#41 +1 missing in TexEditorTools

closed-accepted
None
5
2011-08-09
2010-01-15
No

Hi this patch fixes a classic one of error in TexEditorTools#wrapWordString, which makes "Correct Line Wrap" use 81 instead of 80 characters when wrapping lines. Essentially it was forgotten to count the extra space which has to be added.

Index: source/net/sourceforge/texlipse/editor/TexEditorTools.java

RCS file: /cvsroot/texlipse/net.sourceforge.texlipse/source/net/sourceforge/texlipse/editor/TexEditorTools.java,v
retrieving revision 1.6
diff -u -r1.6 TexEditorTools.java
--- source/net/sourceforge/texlipse/editor/TexEditorTools.java 11 Jun 2009 11:25:25 -0000 1.6
+++ source/net/sourceforge/texlipse/editor/TexEditorTools.java 15 Jan 2010 09:37:24 -0000
@@ -489,7 +489,8 @@
sbout.append(words[0]);
int currLength = indent.length() + words[0].length();
for (int j = 1; j < words.length; j++) {
- if (words[j].length() + currLength <= width) {
+ // Check whether the next word still fits on the current line
+ if (currLength + 1 + words[j].length() <= width) {
sbout.append(" ");
sbout.append(words[j]);
currLength += 1 + words[j].length();

Discussion

  •  
    Attachments
  • Hi,

    thanks for the patch. I have added it to cvs head and it will be fixed in the next release.

     
    • assigned_to: nobody --> borisvl
    • status: open --> open-accepted
     
    • status: open-accepted --> closed-accepted