From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5256 invoked from network); 6 Nov 2023 11:49:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Nov 2023 11:49:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1699271387; b=BioRH2BLMz1+xh5u+kAATh3DGC98F0Lggy/erLSMjrwqS+2PQEekFKsSnYEpo00gpK0dEJpLS0 VlQgSAojR4420O65XaYs8MMpxEaTwRYgeqsar+bZ5ZJgw9yfD1tj1uvX6vmnerq79Flmj/6w1L tlaLYuojVL/pByNT72AXF+BdkuInWdIAcaANoImh9QXrzM3NRNNHlbm51WUn6pszaqgvlNI3QB GFgHPPv7+8XFu/WCGS6M8RDG+QU3Yhp8yt4kzQmdxt5nBNODW7J1C4J1rQBbKSjVtkIvCUL8Sq f/Fcig9doK4pnXdZ7t9b8F+l9x4TNW60ZOULfxtG4XZ+Dw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oo1-f47.google.com) smtp.remote-ip=209.85.161.47; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1699271387; bh=xCMyOqdxaEYuehM5Ymmap2d/iKxvo53sj3TO1T0UqUo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=Mj52VOt/JxmYEGasbiDPoIRMRIS8y+BbUvxbfRiK/7yol7/JPXcDqMbym66OauOkNGfF6QD/Y3 Dd8paYnwljXLDsoE9l+LsHqcNnUrQ8RGZSCtbDzqhozYHSRF5v0T/ygCrAyUrdVsFwAj0RlynQ 0xCJ8qb76S44DfWAz/osnE0AywAQiXOGFAjqPDPEvW6SKJsUbou2RqQkEx/LNHqFB6LB9dcsiJ 6Mm5iz0v+Fdrk6dwzJUtpe/LWXFdGN6je62KFHN3d6nJddo59ki83xMQRjwDay/9/OmFD/r4JG FY4D6xgRGl+onZaEzl9qi2TZ8dfPRZFF09DhwXnFFi4H8g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=VazHH/ONRNWk1XEfNLlmO0AWDYBEPGW0u751EYkiyrQ=; b=dvexnswjiwpplSKR3kE4yDDtGW BUb4K2Bjuei4CnC9I0GqYLA17ZGDP06AtQd5vvBFfnw7/5SaXtLv6HAdoz6WnMK7J+FYNsnEAtwLy E+B6+LEOf80gDYAN9QdLDHK5Joy4B9itadoahyxayTWYWERr6TC9bg1Hrf/aXhz5k3TzQBneNIrMz vuSoCCb4pDwalIIeHklSVnbJbww3bRpOLoVnWI2HJYWDsRB5ci4ZccXHedcFuecDl8/9jXvMyVlEW f4c9C7psa8MOlaaLAO+s0EYa+EP+3ZI1pTFrlxFJl8wXZLbNscw+/e2NpmXNzHMSHTNaYzzlbjzqQ Hc+MgjWQ==; Received: by zero.zsh.org with local id 1qzy6y-000OZS-NG; Mon, 06 Nov 2023 11:49:44 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oo1-f47.google.com) smtp.remote-ip=209.85.161.47; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-oo1-f47.google.com ([209.85.161.47]:38213) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qzy6M-000OGd-Gp; Mon, 06 Nov 2023 11:49:07 +0000 Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-5841a3ffd50so988015eaf.1 for ; Mon, 06 Nov 2023 03:49:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699271345; x=1699876145; darn=zsh.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=VazHH/ONRNWk1XEfNLlmO0AWDYBEPGW0u751EYkiyrQ=; b=njtWFN/HfHO5jJCd+ZmvzwprKjVWrnLiBfHg+k0SpZBI0nftaPFMa4P8dxfoLehi1m ZASDUo+AdV6iMVQw1J+GkHGm1uRDCWOj+1nG17q9PtpWqHKfR5GBRFtds5z9N6B+mKlc pVyg/lcSAa6oL62XPbw1SMOPDaHLCfX3+KWFfKc1MLd83NiBk/wscOa86CeZi42m/BBb 04x3cRnHVolGzl83j4b0POTxdgTxvR56fC0uUb8dUXthQvnZ7J0VinG96vIapAyQRQ91 dXeO5DbErtzhU0uIm0gFTGc9fics7qshPMuTUIwfX6AXb22vqcKJUnhzkanHu6/IA+EA P/MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699271345; x=1699876145; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VazHH/ONRNWk1XEfNLlmO0AWDYBEPGW0u751EYkiyrQ=; b=hXK2eCrlky05qUBoM1lO5bRFm00ah9PqU2zSNBLWv+W/0IA4f8vP+7ON+oEblkmGH/ hNYLbjjCmYJNYTILErp+arQ+v3gK7vL5cBrTpvZq21B14rn607ctzov4YW+r3Sf+qmXF mfQ19+4TtjLuDUroWmSr94lytK5zXP9O6ulV2u4w61G2jFNAYlHsGH9duOe2plqHwJau tUDNBjYwmLeHTILiS/pLloO7WQ3sYH7tu4NuWvZ6SdjDqzmYbbu2ixFSDy1NTbujAdf/ H3Vjo1lj9JruPa9p5rPgGl7c+CuvascbuWoyRUl3UlC7hJkl3FX+CwwG5OwPukXeg+Du bgCw== X-Gm-Message-State: AOJu0YyIorJbuAi9hMz5Vdia9if7+fwnnEuX8dOdjc6damMN1A53zacl dvR8fgcexvUwxCb6fDyct320Yaalw9NGqJGj0O2IhnaWHHA= X-Google-Smtp-Source: AGHT+IHoWDq8VvGxBQoGwRz5XY91CP48jxGxCGn+hnBv0i9HTrPKjw0FTx1S6cp4Z1mX/4wX6ZCNL4JvGBihV5R8bF0= X-Received: by 2002:a05:6870:ef0f:b0:1ea:bb5:a534 with SMTP id qq15-20020a056870ef0f00b001ea0bb5a534mr29510649oab.5.1699271344920; Mon, 06 Nov 2023 03:49:04 -0800 (PST) MIME-Version: 1.0 From: Marlon Richert Date: Mon, 6 Nov 2023 13:48:29 +0200 Message-ID: Subject: [BUG] compadd -R callback function not triggered by custom widget To: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000e41d5806097a70e6" X-Seq: 52276 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000e41d5806097a70e6 Content-Type: text/plain; charset="UTF-8" Given this setup: % zmodload zsh/complist % autoload compinit % compinit % bindkey '^I' tst-complete % zle -C tst-complete menu-select tst-complete % tst-complete() { compadd -Ssuffix -R tst-suffix -- a b } % tst-suffix() { LBUFFER+="len=$1" } % bindkey '^[i' tst-custom % zle -N tst-custom % tst-custom() { zle beginning-of-line } Then the following is expected behavior: # press `:`+Space+Tab % : asuffix a b # completion menu opened # press Escape+`i` % : asuffixlen=6 # tst-suffix was called and cursor was moved to beginning of line However, if we do not call any built-in widget inside our custom widget, then tst-suffix does not get called: % tst-custom() { CURSOR=0 } # press `:`+Space+Tab % : asuffix a b # completion menu opened # press Escape+`i` % : asuffix # cursor was moved to beginning of line, but tst-suffix was not called Interestingly, if we then activate a built-in widget right after, then tst-suffix gets called after all, but with the wrong value: # press Space % len=0 : asuffix --000000000000e41d5806097a70e6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Given this setup:

% zmodload zsh/complist
% autoload compinit
% co= mpinit
% bindkey '^I' tst-comple= te
% zle -C tst-complete menu-select tst-complete
% tst-complete() { compadd -Ssuffi= x -R tst-suffix -- a b }
% tst-suffix() { LBUFFER+=3D"len=3D$1" }
% bindkey '^[i' tst-custom

% zle -N tst-custom
% ts= t-custom() { zle beginning-of-line }


Then the following is expected behavior:

# press `:`+Space+Tab% : asuffix
a = =C2=A0b
# completion menu opened

# press Escape= +`i`
% : asuffixlen=3D6
#=C2=A0tst-suffix was called and cursor was moved to beginning of line


However= , if we do not call any=C2=A0built-in widget inside our custo= m widget,
then=C2=A0tst-suffix=C2=A0does not get called:

% tst-custom() { CURSOR=3D0 }
<= br>
# press `:`+Space+Tab
% : asuffix
a =C2=A0b
# completion menu opened

# press Escape+`i`
% : asuffix# cursor was moved to beginning = of line, but tst-suffix was not called


<= /font>
Interestingly, if we then activate a built-in widget right a= fter,=C2=A0
then=C2=A0tst-suffix=C2=A0gets called afte= r all,=C2=A0but with th= e wrong value:

<= div class=3D"gmail_default" style=3D""># press Spa= ce
% len=3D0 : asuffix
<= /font>

--000000000000e41d5806097a70e6--