nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] File insertion revamp


From: David Ramsey
Subject: [Nano-devel] File insertion revamp
Date: Mon, 13 Feb 2017 14:18:39 -0600

The attached set of 9 patches does the following:

- fixes three minor cosmetic nits (these are the first 3 patches in the
set)

- revamps read_file() and related bits to insert a file into the current
buffer, much like do_uncut_text() does (so that it also counts inserted
lines properly when determining whether it needs to do a focused
refresh); in the process, it separates a new function
move_from_filestruct() from copy_from_filestruct(), as the latter would
unnecessarily duplicate the file in memory

- removes the partitioning code from do_insertfile(), as it's now no
longer necessary

- adjusts the undo code to account for do_insertfile()'s no longer using
the partitioning code (it seems to work so far, but I've never touched
the undo code before this, so it could use double-checking)

- fixes spell-checking marked text in the alternate spell checker to no
longer use the partitioning code, since read_file() now indirectly uses
it, and trying to do that twice causes a segfault, since there can only
be one partition at a time; in the process, it uses move_to_filestruct()
to throw away text and read_file() to insert the replacement text in the
same spot

- removes the partitioning code from the unjustifying portion of
do_justify(), since it can now use move_to_filestruct() to throw away
the justified paragraph and move_from_filestruct() to put the
unjustified paragraph back in the same spot

Note that this patch set removes the partitioning code from all the
places where it's relatively easy and will not require massive rewrites
to do so (alternate-spell-checking marked text aside, of course).

After applying this, the only places where the partitioning code is
still used (aside from the high-level filestruct operators
move_to_filestruct(), move_from_filestruct(), and [indirectly]
copy_from_filestruct(), which I think are okay) are write_marked_file()
and do_wordlinecharcount().

Attachment: insertfile-revamp.zip
Description: Zip archive


reply via email to

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