nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [PATCH] delete a marked region or line without affectin


From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] delete a marked region or line without affecting the cutbuffer
Date: Tue, 23 Oct 2018 17:20:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

Op 22-10-18 om 07:30 schreef Brand Huntsman:
> @@ -791,6 +791,12 @@ void do_undo(void)
>       case SPLIT_BEGIN:
>               undidmsg = _("text add");
>               break;
> +#endif
> +#ifndef NANO_TINY
> +     case ZAP:
> +             undidmsg = _("text zap");
> +             undo_cut(u);
> +             break;
>  #endif

The #if is not needed: the whole undo code is not present in the
tiny version.  Several more of them further down.

> address@hidden -Z
> address@hidden --zap
> +Zap marked region with unmodified backspace or delete keys.

"Let an unmodified Backspace or Delete erase the marked region without
affecting the cutbuffer."

> +     print_opt("-Z", "--zap",
> +                                     N_("Zap marked region with unmodified 
> backspace or delete keys"));

This string should ideally fit within 40 characters, so that the
--help text will fit without wrappings on an 80-column terminal.

"let Bsp and Del erase a marked region"

>       TABS_TO_SPACES,
>       QUICK_BLANK,
>       WORD_BOUNDS,
> +     ZAP_BSP_DEL,

I will rename this flag to "LET_THEM_ZAP".  It should be added at the
end of the list -- that is where new flags get added.

>       } else if (keystring[0] == 'M') {
> +             if (strcasecmp(keystring, "M-Del") == 0)
> +                     return ALT_DELETE;

This will not be added.  The M-Del keystroke will not be rebindable,
just like ^Del and Sh-^Del are not rebindable.  (That Del itself is
rebindable is a leftover from the past.)

>               case 1:
> -                     if (keycode >= 0x80)
> +                     if (keycode == KEY_DC)
> +                             retval = altdelete;
> +                     else if (keycode >= 0x80)
>                               retval = keycode;

No, this will not be added either.  <Esc> <Del> will not be equivalent
to <Alt+Del>, just like <Esc> <Enter> is not equivalent to <Alt+Enter>
and <Esc> <Down> is not equivalent to <Alt+Down>, and so on.

>       else if (retval == altdown)
>               return ALT_DOWN;
> -     else if (retval == shiftaltleft) {
> +     else if (retval == altdelete) {
> +             meta_key = TRUE;
> +             return ALT_DELETE;

Why does 'meta_key' need to be set?  It is not set for the other 'ALT_'
keystrokes.  Same thing further down.

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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