#303 Hard word wrap should not introduce new spaces

qcodeedit (21)

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 - 2012-06-20

    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 - 2012-06-20

    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 - 2012-06-20

    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 - 2012-06-20

    Works like a charm. Thank you.

  • Benito van der Zander

    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 - 2012-06-21

    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. - 2013-01-07

    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

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks