From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25048 invoked by alias); 15 Jul 2015 17:33:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35795 Received: (qmail 17675 invoked from network); 15 Jul 2015 17:33:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,FSL_HELO_BARE_IP_2, RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.0 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Yuri D'Elia Subject: Re: bracketed paste Date: Wed, 15 Jul 2015 19:33:13 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.18 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.0 In-Reply-To: On 15/07/15 18:51, Yuri D'Elia wrote: > I'd like to do the same using the final widget if possible. To give an example, if you still remember the code I posted earlier: function _end_paste() { bindkey -e setopt localoptions extendedglob _paste_content=${${_paste_content%%[[:space:]]#}##[[:space:]]#} [[ $_paste_quoted == 1 ]] && LBUFFER+=${(q)_paste_content} || LBUFFER+=$_paste_content unset _paste_content _paste_quoted } And yes, that whitespace trimming looks ugly. Is there a better way?