From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43754-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id ec728504 for ; Sat, 3 Nov 2018 00:04:07 +0000 (UTC) Received: (qmail 5997 invoked by alias); 3 Nov 2018 00:03:55 -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: List-Unsubscribe: X-Seq: 43754 Received: (qmail 14195 invoked by uid 1010); 3 Nov 2018 00:03:55 -0000 X-Qmail-Scanner-Diagnostics: from firebrick.maple.relay.mailchannels.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(23.83.214.59):SA:0(-2.0/5.0):. Processed in 1.982236 secs); 03 Nov 2018 00:03:55 -0000 X-Envelope-From: wayne@opencoder.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Sender-Id: dreamhost|x-authsender|dropbox@opencoder.net X-Sender-Id: dreamhost|x-authsender|dropbox@opencoder.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dropbox@opencoder.net X-MailChannels-Auth-Id: dreamhost X-Irritate-Descriptive: 49ef63ab5d193c79_1541203429148_1514872798 X-MC-Loop-Signature: 1541203429148:553817415 X-MC-Ingress-Time: 1541203429148 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=opencoder.net; h= mime-version:from:date:message-id:subject:to:content-type; s= opencoder.net; bh=dSLS2OGKJJ0uQ0oNX8dx5Pky6SI=; b=LzoWlB/hgI8aNO 5fVlya8DnifUvtoookPqderQkZkF1lyfcLQ10C1or5/8WvtQ5Ks6+v4m0RR3uMcc FPVFH+PMuIBsli/nadmv+SjZ0o8dDVk5ElkCjF4e2yBaIAbOGAeJmMWhbryiIfCh XEuJ14o2ziQ8AfoLKL7XxbwbFUPpg= X-Gm-Message-State: AGRZ1gLpWIIqEEaFvjZjqi2c2kJ0gf4Xw2fGgnquxilw8PAyJGG9cy16 oW+70JY8x2DRCa/w/7AfcbGCfcMM4nvl4gGWoTg= X-Google-Smtp-Source: AJdET5d4cBx/mFMKRFaDZm2ykaJcaYxkM0KUmBXbprjVhKm9fAfRQdbUZa3fMg1dVc+o4NtcPi6AfwcJmlxvyRyxTYQ= X-Received: by 2002:a9d:7749:: with SMTP id t9mr8758824otl.342.1541203427299; Fri, 02 Nov 2018 17:03:47 -0700 (PDT) MIME-Version: 1.0 X-DH-BACKEND: pdx1-sub0-mail-a23 From: Wayne Davison Date: Fri, 2 Nov 2018 17:03:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: A weird smart-insert-last-word bug To: Zsh list Content-Type: multipart/alternative; boundary="000000000000cf9a2f0579b76212" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrjedtgddulecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepggfhfffkuffvtgesrgdtreertddtjeenucfhrhhomhephggrhihnvgcuffgrvhhishhonhcuoeifrgihnhgvsehophgvnhgtohguvghrrdhnvghtqeenucfkphepvddtledrkeehrddvuddtrdehfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlqdhothduqdhfheefrdhgohhoghhlvgdrtghomhdpihhnvghtpedvtdelrdekhedrvddutddrheefpdhrvghtuhhrnhdqphgrthhhpeghrgihnhgvucffrghvihhsohhnuceofigrhihnvgesohhpvghntghouggvrhdrnhgvtheqpdhmrghilhhfrhhomhepfigrhihnvgesohhpvghntghouggvrhdrnhgvthdpnhhrtghpthhtohepiihshhdqfihorhhkvghrshesiihshhdrohhrghenucevlhhushhtvghrufhiiigvpedt --000000000000cf9a2f0579b76212 Content-Type: text/plain; charset="UTF-8" Here's something I've seen very sporadically but I couldn't work out a test case before today. I make use of smart-insert-last-word like this: zlewidget '' insert-last-word smart-insert-last-word zstyle :insert-last-word match '[^,]??*' zstyle :insert-last-word auto-previous 1 Every now and then it destroys some part of the command line when starting a new insert sequence. This seems to be caused by its simple conditional at the start of its file being inadequate to know when it is really continuing: if (( HISTNO == _ilw_hist && cursor == _ilw_cursor && UNDO_CHANGE_NO == _ilw_changeno )) Since I have hist_ignore_space set, this makes it possible to trigger the bug on successive command lines when typing a series of commands that begin with a space. Imagine that the underscore char is a leading space: echo foo echo bar _echo . _echo .. testing12. at that point the command buffer will be "testinfoo". Note that it took 2 space-starting commands to be able to trigger the bug on a successive command-line and that the column has to line up with the column where it left off on the prior line. The bug can also happen during an edit on a single line if you initiate the function a second time from the column where it left off, even though some editing has happened in between. For example: echo .bug. ..wayne.. --000000000000cf9a2f0579b76212--