Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: History still coredumping after "print -s" during completion



On May 29,  2:30pm, Wayne Davison wrote:
} Subject: Re: History still coredumping after "print -s" during completion
}
}  + It tweaks execzlefunc() so that, when it calls a completion
}    widget, it ensures that if we were at curline, we're still at
}    curline.  This change assumes that completion never causes us to
}    change to a different history line.  If this is not true, we'll
}    need a different fix.

Completion shouldn't ever cause us to change to a different history line,
but an ordinary ZLE widget might.

    foo() {
      zle up-line-or-history
      print -s "Hi there"
      zle down-line-or-history
    }
    zle -N foo
    bindkey ^Xj foo

} With these changes, your example now works right:
} 
} % ls <C-x?><C-n>
} 
} This will now fail to move downward (since there's nowhere to go),
} and a <C-p> will show you the newly-added history line.

Yay!  Thanks, Wayne.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author