nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] the mechanics of wrapping


From: Mark Majeres
Subject: Re: [Nano-devel] the mechanics of wrapping
Date: Wed, 2 Jul 2014 06:30:24 -0700

> On Sun, Jun 29, 2014, at 20:36, James Freer wrote:
>> I notice that colleagues and yourself are doing some development work
>> on wrapping lines and i was wondering if you were considering softwrap
>> for nano.
>
> You didn't answer what I asked you earlier:
>
>> > Ah.  You mean a softwrap that only breaks at whitespace?
>
> That would be a cool feature, but I'm not looking into it.  And
> the work that Mark is doing is about hard-wrapping, putting real
> linefeeds into the file.  Maybe when that is done and working
> flawlessly Mark will be so versed in this code that he can have
> a look at the softwrapping and solve it in twenty minutes.  :)

Hi Benno and James,

I looked at the requirements for adding this feature.  It was going
well, but then I ran into a small bump.  When softwrap is enabled, the
number of lines occupied on-screen may not be 1:1 with the number of
lines in memory.  A file that has 10 lines of text may require 10+
lines of the screen.  To accomodate this, nano *frequently* calculates
the needed screen lines.  The current calculation is based on a
constant break point and isn't too intensive.  Breaking lines between
words greatly increases the required processing.

To minimize the processing for this feature I can add a new member to
the filestruct that will store the number of screen lines for each
line of text in the file.

I wanted to clarify the requirements before starting the edits.
Should breaking at a word boundary be the default for softwrap?  Is
there any reason why someone would prefer to have nano break mid-word
as it currently does?

--Mark Majeres



reply via email to

[Prev in Thread] Current Thread [Next in Thread]