[Geany] Line breaking vs Reflow lines behavior

Eugene Arshinov earshinov at xxxxx
Sun Mar 18 09:24:41 UTC 2012


On Sun, 18 Mar 2012 13:00:44 +1100
Lex Trotman <elextr at gmail.com> wrote:

> On 18 March 2012 09:42, Toni Wiki <toniwiki at gmail.com> wrote:
> > I am new Geany user and in this mailing list so Hi all from Spain.
> >
> > With your permission, i will start with a question.
> >
> > I am running Geany 0.21 on Ubuntu.
> >
> > I have setting "Line breaking column" in Prefs at 72 and "Line
> > Breaking" option enabled. When i type a word past this limit Geany
> > insert a carriage return at the end of the line and put the cursor
> > on the line below. Now on the same paragraph if i do a "Reflow
> > Lines/Block" the lines are cut at 70 position. The same for
> > diferents "Line breaking column" values (cuts at 2 less "Line
> > breaking column" value).
> >
> > Is this a right behavior ? Thanks.
> > (Sorry for my sorry English)
> >
> 
> Hi Toni,
> 
> This is known behaviour.  The two ways of doing line breaking are
> performed differently.
> 
> The difference between the two is that line breaking on input is
> performed by Geany based on character columns, whereas reflow is
> performed by Scintilla (the editing component Geany uses) using line
> widths in pixels calculated based on the width of a space in the
> default style.
> 
> We are not sure why these are different (at least when everything uses
> fixed fonts) but it may be due to differences in counting columns (ie
> is column 72 on the left of the character or the right?), different
> handling of trailing spaces and off-by-one pixel counts cause the
> latter to break more conservatively than the former.
> 
> IIRC fiddling with offsets didn't seem to cure it, so until someone
> authoritatively finds why the difference there is no known cure.
> 

Hi guys.

First of all, I must tell that it was me who proposed a patch to
implement split/join lines commands in Geany which eventually
became "Reflow paragraph".

Second point, even I don't remember why I didn't reuse the code
implementing line breaking option (which was already written then).
Maybe, as I already used SCI_JOINLINES, I considered SCI_SPLITLINES
first and it did the job rather well (but not perfectly, as I
understood after quite some time).

Third point, there are already some bug reports on the same topic
(just search the bug tracker for "reflow"):

1.https://sourceforge.net/tracker/index.php?func=detail&aid=3293009&group_id=153444&atid=787791
  My summary: SCI_SPLITLINES breaks lines on style boundary.  I think,
  this behaviour is unneeded and sometimes just wrong for "reflow"

2.https://sourceforge.net/tracker/index.php?func=detail&aid=2982136&group_id=153444&atid=787791
  An older bug report on the same topic as (1)

3.http://sourceforge.net/tracker/index.php?func=detail&aid=2871809&group_id=153444&atid=787791
  Line is broken too early (just what Toni talks about).  I posted a
  long comment to this bug report (my nick on SourceForge is statc),
  particularly explaining why Scintilla does not work "properly".

4.http://sourceforge.net/tracker/index.php?func=detail&aid=2923338&group_id=153444&atid=787791
  Seems to be a duplicate of (3)

Fourth point, for some time I was going to raise a topic about
reimplementing "Reflow paragraph" myself.  Two things stopped
me from doing it: (1) an absence of free time; (2) the fact that I
propose other little patches to Geany from time to time and I don't
want to bother Geany developers / maintainers too much. 

Some time ago I posted a bug report to Scintilla [1].  They don't want
to refine SCI_SPLITLINES, so my proposal is to rewrite "Reflow
paragraph" reusing the code which implements line breaking.  I can do
it myself, but not now.

Sorry for a long message.  I'm now waiting for a reply on my proposal.

[1]:<https://sourceforge.net/tracker/index.php?func=detail&aid=3475314&group_id=2439&atid=102439>

--
Best regards,
Eugene.




More information about the Users mailing list