nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] the difficulties of behaving similar


From: Mark Majeres
Subject: Re: [Nano-devel] the difficulties of behaving similar
Date: Wed, 18 Jun 2014 13:45:00 -0700

Benno,

> By the way, this 'u->mark_begin_lineno == fs->current->lineno',
> does it not only apply to the case of 'current_action == ADD'?
yes it applies to both CUT and ADD, the statement has parenthesis and reads
(<condition>&&(<condition>||<condition>))

> For the 'current_action == CUT' condition the mark must not be set,
> so then 'u->mark_begin_lineno' should be irrelevant, no?

u->mark_begin_lineno locates the start of *all* cuts, marked or not.

> And further, is it possible for 'u' to be NULL there?  And if not,
> wouldn't an assert make more sense?
yes, u can be null, it's the first check being done in the conditional,
if it is NULL, then shortly after the check a new u is allocated and initialized

> However, in a later patch I will probably move the cutbuffer_reset()
> call to places where they make more sense to me.
Nah, just keep reading the code until it makes sense :)
Relocating the call will only add a pitfall. If someone decides to remove
one of the other calls in nano.c the cut/paste functions will still work fine.
The same cannot be said about the one in add_undo.

--Mark



reply via email to

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