From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23392 invoked by alias); 15 Dec 2013 01:15:32 -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: 32113 Received: (qmail 28934 invoked from network); 15 Dec 2013 01:15:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <131214171514.ZM25883@torch.brasslantern.com> Date: Sat, 14 Dec 2013 17:15:13 -0800 In-reply-to: <20131214204319.2a04428f@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: Bug report" (Dec 14, 8:43pm) References: <9CB4226B-47EE-44FA-8F8F-01DF4CB5154D@gmail.com> <131214110830.ZM18442@torch.brasslantern.com> <20131214204319.2a04428f@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Bug report MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 14, 8:43pm, Peter Stephenson wrote: } } Seems to work: I've sanity checked for negative values and the worst I } can see happening with large numbers is the prompt doesn't appear. Something isn't quit right here. In the copy-paste below, pay attention to what happens to the left prompt; the placement of the right prompt is correct, though vagaries of email may have muddled the line width or wrapping: torch% setopt promptsubst torch% PS1=987654321_ RPS1='$ZLE_RPROMPT_INDENT' 987654321_ Cursor is immediately to the left of the "_" as expected. 987654321_ZLE_RPROMPT_INDENT=1 987654321_ZLE_RPROMPT_INDENT=2 1 987654321ZLE_RPROMPT_INDENT=3 2 98765432ZLE_RPROMPT_INDENT=4 3 9876543ZLE_RPROMPT_INDENT=5 4 987654ZLE_RPROMPT_INDENT=6 5 98765ZLE_RPROMPT_INDENT=7 6 987654321_ 7 Cursor is presently on the "5" digit in PS1. 9876ZLE_RPROMPT_INDENT=0 7 987654321_ echo oops 0 oops Cursor is now one full space to the right of the "_". So whatever moves the cursor "back" to PS1 after drawing RPS1 still calculates as if the right-indent is always 1. If I set ZLE_RPROMPT_INDENT to a value larger than the number of characters in $PS1 but smaller than $COLUMNS, the cursor actually moves up to the line above, which I can't really show with cut-and-paste. It appears that if you want to make this offset different from 1, you are going to have to change countprompt() to include the offset in the width of the prompt rather than just fiddle with math in the output code.