zsh-workers
 help / color / mirror / code / Atom feed
From: "Mikael Magnusson" <mikachu@gmail.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: Remove (probably?) unhelpful check in narrow-to-region
Date: Mon, 2 Oct 2006 00:50:12 +0200	[thread overview]
Message-ID: <237967ef0610011550m68473684q1184eb22b5190f33@mail.gmail.com> (raw)

With this change, you can press set-mark, narrow-to-region with the
cursor in the same place, without it you always have to include one
character in the narrowed region. This is useful for example if you
want to insert some command from history, just press the combo and
history search or whatever like usual, then press enter. I tried it
out for a bit and i haven't been able to find any negative effects.

PS I tried to include some ansi color codes in the -p and -P arguments
but they just get printed literally, would it be possible to print
them evaluated instead? I stared at the code for 5 minutes but
couldn't figure out where the extra quoting is added.

Index: Functions/Zle/narrow-to-region
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zle/narrow-to-region,v
retrieving revision 1.2
diff -p -u -d -r1.2 narrow-to-region
--- Functions/Zle/narrow-to-region	5 Jul 2002 10:49:47 -0000	1.2
+++ Functions/Zle/narrow-to-region	1 Oct 2006 22:46:23 -0000
@@ -68,9 +68,7 @@ if [[ -n $_ntr_save || -z $_ntr_restore
     _ntr_end=$CURSOR
   fi

-  if (( _ntr_start == _ntr_end )); then
-    return 1
-  elif (( _ntr_start > _ntr_end )); then
+  if (( _ntr_start > _ntr_end )); then
     _ntr_swap=_ntr_start
     _ntr_start=_ntr_end
     _ntr_end=_ntr_swap


-- 
Mikael Magnusson


             reply	other threads:[~2006-10-01 22:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-01 22:50 Mikael Magnusson [this message]
2006-10-02 10:08 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=237967ef0610011550m68473684q1184eb22b5190f33@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).