Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: make history-complete-older do nothing on empty string
- X-seq: zsh-users 23347
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: make history-complete-older do nothing on empty string
- Date: Wed, 18 Apr 2018 09:11:11 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=+zKK6tL+ODrXzpQfg5ZP2taG8XR7gTQPp9pq41r5Aro=; b=bboSh1RGRD8PaRzwtRBFS43m9hTI03Qi6yD2HUgEDWQTUguZjwL/HzY2ffFcX0jCJW LgPUJiaotGmOCy+l9qZLMJVxZwick890sZpmtX4/TFW+3tsj1DQ2jlEZ6ZK0D6W4TXPo 0ZUI56MLFQt7Chx3yII8/TtjTJopEaIfsD+qVRg6FR3qPzn+ilTHFm6nKngE/COlB1hP 7qGBZNmlPcAXKNCiRQkEnTg2+w9hNWsunFYfkBIeeQOm358f5H5ROpOPwHWO6KiPNcDn it9YL/Ln3jLyywmuLfgqO4js01kdBhrNG1bT/tgrT5gC55OGRE2X4hFVek0602JiRk7W /1mA==
- In-reply-to: <20180418135817.7edca58c@camnpupstephen.cam.scsc.local>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20180418052832epcas2p1df623a44c88edae226f65a2d5edc90f2@epcas2p1.samsung.com> <m3tvs9um1s.fsf@luffy.cx> <20180418094018.54559594@camnpupstephen.cam.scsc.local> <87in8o6fjx.fsf@luffy.cx> <20180418104555.25fef55b@camnpupstephen.cam.scsc.local> <874lk866zp.fsf@luffy.cx> <20180418135817.7edca58c@camnpupstephen.cam.scsc.local>
On Wed, Apr 18, 2018 at 5:58 AM, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
>
> So when you interrupted it it was apparently reading in 66742 history
> words
Some people have really large shell history. Manipulating that many
completion possibilities takes a long time.
Vincent, what version of zsh are you running? There were some memory
management optimizations done in the past year or so that might speed
up large history accesses in general.
Although it would be nice to find out exactly what part of completion
is occupying time in this case (if only so that we might look into
making it interruptible), to answer the original question:
You'd want a wrapper around _history_complete_word to check the state
of the editor buffer, or you could copy that function to a location at
the front of your $fpath and modify it. The test you want is probably
something like:
[[ ${LBUFFER:- } == ' ' && ${RBUFFER:- } == ' ' ]] && return 1
There's a space after :- in both of those references. This means "if
either the buffer is empty or the cursor is sitting in the middle of a
run of spaces, then return" (i.e. don't complete anything).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author