nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Add function to convert leading whitespace to tabs


From: Erik Lundin
Subject: Re: [Nano-devel] Add function to convert leading whitespace to tabs
Date: Sun, 19 Oct 2014 17:10:00 +0200

On Sun, 2014-10-19 at 16:14 +0200, Benno Schulenberg wrote:
> On Sun, Oct 19, 2014, at 15:00, Erik Lundin wrote:
> > I've implemented the undo functions but looking through the undo code i
> > notice that the variable holding the line data in the undo struct is:
> > 
> > char *strdata;
> > 
> > This makes undoing/redoing the "indent/unindent :-)/whitespace to tabs"
> > a lot harder when it's done by selecting multiple lines.
> 
> Would a different representation of the line data make such mass
> undoings significantly easier?  If so, how?

Keeping all the joined undos in a linked list inside the main undo list
would be a clean way of storing the lines. That way you can iterate
through all connected lines in one undo. This could also be used to undo
search/replace all and indents/unindents etc.

I've attached a revised patch with the key-mappings removed and basic
undo-support.
-- 
Erik Lundin <address@hidden>

Attachment: nano_whitespace_to_tabs_3.patch
Description: Text Data


reply via email to

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