nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Softwrap navigation overhaul


From: David Ramsey
Subject: Re: [Nano-devel] Softwrap navigation overhaul
Date: Wed, 8 Feb 2017 16:26:05 -0600

> Additionally, while trying to get the read_file() changes right
> yesterday, I noted that read_file() seems to only be used to read into
> empty buffers, except for do_insertfile(), but do_insertfile() uses
> partition_filestruct() to make the buffer *appear* empty first, so if
> I'm reading things right, read_file() could probably be simplified.

Forget this.  The softwrap overhaul line counting in read_file() in the
latest patchset may be off as much as one line because of the use of
partition_filestruct(): the latter changes the text on the starting line
of the partition, so it changes the column count and hence the
softwrapped line count.

read_file() currently assumes that we're inserting a file starting at
the beginning of the line before current, and tacks current's text onto
the end if necessary (it's old code).  To fix the aforementioned problem
properly, it should actually be adapted to insert a file starting at
current[current_x], and tack current's remaining text onto the end if
necessary; after this, its direct use of partition_filestruct() should
be removed.  In short, it needs to behave more like the uncutting code
if it's going to properly count softwrapped lines like the uncutting
code: maybe read the file into a new temporary buffer, and then use
copy_from_filestruct() to put it in place, the way the uncutting code
does?  And would that break undoing inserts?

As for the Chinese two-column Unicode character problems, determining
whether the line ends with a partial two-column character is more
difficult than I thought.  Determining the first column of the current
softwrapped chunk when there are unbreakable two-column characters might
be easier by comparison.

So... I may take a break from this for a bit to try and figure some of
these issues out, since I've been going overboard on this lately.
Although, after some thought, patch 0032 in the set might count as
separate from the overhaul?

Thanks for your patience.



reply via email to

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