Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#303 Hard word wrap should not introduce new spaces

qcodeedit (21)
Kirill Müller

When editing the following line:


TeXStudio introduced a hard line wrap between "igno" and "refoot" (margin=80).

Please avoid adding new space with the hard word wrap feature. (Latest SVN build, r2966.)


  • Tim Hoffmann
    Tim Hoffmann

    This is a fallback, because the editor did not find a space for splitting

    What would be the correct solution in such a case?
    - split as special chars: {},
    - break the 80 char limit

  • Kirill Müller
    Kirill Müller

    I'd opt for simply breaking the limit in this case. The meaning of special characters might be redefined, and then the break still would be wrong.

    The user will notice that the line is too long and introduce a break manually if required.

  • Tim Hoffmann
    Tim Hoffmann

    implemented in rev. 2970:

    Violate width rather than wrap inside the word.

    I applied this only to hard wrapping. For soft wrapping the current behaviour is fine, because no actual whitespace is inserted and saved. Furthermore soft wrapping is mainly to limit the visual width. So here it is reasonable actually to wrap inside a word rather than exceed the width limit.

  • Kirill Müller
    Kirill Müller

    Works like a charm. Thank you.

  • No, I don't think that is a good idea.

    The hard wrap should be hard and break all lines

    It could become


    On 06/21/12 11:07, SourceForge.net wrote:


  • Tim Hoffmann
    Tim Hoffmann

    Why? Do some applications need strict wrap widths?

    You could introduce an option for the wrapping behavior. Actually I considered that in the first place, but because I didn't thought this to be important, I didn't bother to write all the code to propagate the option down from the config dialog to the document.

  • Mast B.
    Mast B.

    My opinion is that, since you're dealing with Tex, you can add a "%" in front of any "\" or "{" or after "," etc found in the line and hard-wrap there. That won't break anything in Tex but will be able to wrap long lines without spaces. Yes, it affects the Tex code, but hard-wrapping would affect it anyway ...

    For the above example, this would be fine:


    Last edit: Mast B. 2013-01-07