zsh-workers
 help / color / mirror / code / Atom feed
* 4.3.0-dev-2 BUG: negative cursor position
@ 2005-12-12 14:14 Jun T.
  2005-12-12 18:46 ` Wayne Davison
  0 siblings, 1 reply; 2+ messages in thread
From: Jun T. @ 2005-12-12 14:14 UTC (permalink / raw)
  To: zsh-workers

Hi zsh-workers,

Is this the right place to report a zsh bug?

I tried 4.3.0-dev-2 with --enable-zsh-debug.

old-zsh% /usr/local/bin/zsh -f
new-zsh% bindkey -v
new-zsh% <ESC>kj

Here, <ESC> is to go into the vi-command mode.
Then I hit 'k' to go up in history stack; it worked as expected.
Then I hit 'j' to go down in the stack, but I get the following message:

BUG: negative cursor position

With gdb, I found that zlecs becomes negative at line 674 of zle_hist.c.
Replacing

    if (invicmdmode())

by

    if (zlecs > findbol() && invicmdmode())

"apparently" fixed the problems but I know NOTHING about the zsh source code.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 4.3.0-dev-2 BUG: negative cursor position
  2005-12-12 14:14 4.3.0-dev-2 BUG: negative cursor position Jun T.
@ 2005-12-12 18:46 ` Wayne Davison
  0 siblings, 0 replies; 2+ messages in thread
From: Wayne Davison @ 2005-12-12 18:46 UTC (permalink / raw)
  To: Jun T.; +Cc: zsh-workers

On Mon, Dec 12, 2005 at 11:14:05PM +0900, Jun T. wrote:
> Is this the right place to report a zsh bug?

Yes, this is a very good place for that.

> With gdb, I found that zlecs becomes negative at line 674 of zle_hist.c.

Good catch -- that code is new for 4.3.x: it's a slightly optimized
version of some setline() code, but the check to see if zlecs was non-
zero was accidentally dropped from the algorithm.  I've checked in a
fix.  Note that your suggested fix will work just fine, but I ended up
using a slightly different check (taken from setline()) where it just
checks zlecs against 0 instead of calling findbol().

Thanks for the report,

..wayne..


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-12 18:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-12 14:14 4.3.0-dev-2 BUG: negative cursor position Jun T.
2005-12-12 18:46 ` Wayne Davison

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).