#382 reflow column problem

General (289)
Michal Kaut

I have a problem with the new reflow feature of Geany 0.18 on Ubuntu 9.04 x64:
I want the lines to break after column 80, so I have both the "Line breaking column" and "Long line marker" set to 80. With this setup and line-breaking ON, the lines will break after column 79 (not 80 - feature or bug?) when writing new text, but earlier with the reflow command: the first line of the paragraph/selection breaks after column 76, all other lines after column 75, i.e. 5 characters too early.

Geany 0.18, GTK+ 2.16.1, GLib 2.20.1 from the Ubuntu Geany PPA


  • Nick Treleaven

    Nick Treleaven - 2009-11-12

    Are you using a fixed-width font?

    Could you provide instructions to reproduce the bug?

  • Eugene

    Eugene - 2012-01-20

    This problem can easily be seen even if fixed-width fonts are used. It seems, this is hardly fixable as long as Scintilla's line splitting functions are used. Some information *FOR DEVELOPERS* follows. TL;DR: splitting should be reimplemented in Geany to fix this bug.

    At Scintilla level, SCI_LINESSPLIT is just a useful addition to the builtin line wrapping functionality. Judging by bug report [sci1] that I recently sent to Scintilla, its developers don't strive to refine this functionality so that it's better suited for *splitting*.

    For me, it seems to be the cause of problems. Suppose we have a long line that we are going to split, and we found a space symbol at position 80 that is going to be a good split point. Actually, it might even be a non-space symbol, because Scintilla can split lines on style boundary, as seen in [sci1] and another bug report for Geany [gea2]. So, Scintilla uses the same functions as for line wrapping, and for line wrapping it mustn't remove the space symbol itself -- the symbol should be left so that user can place cursor on it and edit it. As for wrapping and splitting the functions and their behaviour are same, the line is split kind of earlier than it should be. Seems that the space symbol, carefully preserved by Scintilla, is removed in Geany's code (as necessary -- user obviously doesn't need this space after splitting).

    Okay, this doesn't explain the difference in *5 chars*. But there are other nuances "inherited" from line wrapping functionalty. For example, some space is reserved for so-called "visual line end marker" (which is absolutely useless in case of splittling). I didn't dig for more.

    Soz for a so long message.

    [sci1]: https://sourceforge.net/tracker/index.php?func=detail&aid=3475314&group_id=2439&atid=102439
    [gea2]: http://sourceforge.net/tracker/index.php?func=detail&aid=3293009&group_id=153444&atid=787791

  • Lex Trotman

    Lex Trotman - 2012-09-14

    There is a pull request to update the reflow to give exactly the same results as line breaking. This bug is pending the acceptance or rejection of that.

  • Lex Trotman

    Lex Trotman - 2012-09-14
    • status: open --> pending-postponed
  • Lex Trotman

    Lex Trotman - 2013-04-21
    • status: pending-postponed --> closed-fixed
  • Lex Trotman

    Lex Trotman - 2013-04-21

    Fix committed to Git, both reflow and line break should now break at the same place, and correctly.

  • Colomban Wendling

    • milestone: --> v1.24

Log in to post a comment.

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

Sign up for the SourceForge newsletter:

No, thanks