Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: buggy paste highlight with backward-extend-paste



On Dec 9, 10:13am, Vincent Lefevre wrote:
} Subject: Re: buggy paste highlight with backward-extend-paste
}
} > On Tue, Dec 8, 2015 at 6:16 PM, Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
} > >
} > >   zstyle :bracketed-paste-magic paste-init backward-extend-paste
} 
} But I don't want to extend the paste backward!

So I gather, but I did name it that way for a reason. :-)

} Note that I have the zstyle above just to make the paste correct in
} the following case:
} 
} # Helper/example paste-init for exposing a word prefix inside PASTED.
} # Useful with url-quote-magic if you have http://... on the line and
} # are pasting additional text on the end of the URL.
} 
} But affected the highlight is not expected.

This is one reason that Mikael keeps pushing his simplified variant where
you have no choice but to paste the entire URL rather than just a suffix
of it.

To "fix up" the highlighting, you'd also need a paste-finish action to
coordinate with backward-extend-paste.  E.g.:

- In backward-extend-paste, save $bep_words[-1] in a global variable.

- In the paste-finish function, compare that saved global to the
leftmost part of $PASTED, and if they match, delete it from $PASTED
and append it to $LBUFFER.

- Also in paste-finish, possibly fix up the position of MARK.

If you come up with something that works, I'd be happy to look at it.
Otherwise it may be a while before I make an attempt.



Messages sorted by: Reverse Date, Date, Thread, Author