From a015d10c67c9cbc6448d25156b1b7841c0337153 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 7 Jun 2012 10:35:01 +0200 Subject: [Keys/Prompt] up up and awayyy --- 12_Prompts.zsh | 11 ++++++++--- user:hugues/KeyBindings.zsh | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 4e70f66..20a4f94 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -91,6 +91,13 @@ __get_prompt_lines() echo $lines } +# Rewrites current prompt. +__up_up () +{ + for i in {1..$(__get_prompt_lines)} + tput cuu1 +} + preexec () { __term_title "$2" @@ -101,10 +108,8 @@ preexec () __hbar __redefine_prompt - local lines=$(__get_prompt_lines "$1") - tput sc - for i in {1..$lines} ; tput cuu1 + __up_up # Only redraws the date, not the full prompt, since we got glitches with BANG_HIST and AUTOCORRECT... print -Pn $(tput cub $COLUMNS ; tput cuf $(($COLUMNS - $DATESIZE)))$C_$_prompt_colors[bar]$_C$DATE tput rc diff --git a/user:hugues/KeyBindings.zsh b/user:hugues/KeyBindings.zsh index 2863542..af31b88 100644 --- a/user:hugues/KeyBindings.zsh +++ b/user:hugues/KeyBindings.zsh @@ -237,7 +237,7 @@ do bindkey -M $keymap 'q' push-line bindkey -M $keymap 'Q' push-line - bindkey -M $keymap -s 'K' 'Q for i in {1..$(__get_prompt_lines)} ; tput cuu1\n' + bindkey -M $keymap -s 'K' 'Q __up_up\n' bindkey -M $keymap -s 'B' 'Q tput clear ; tput cup $(tput lines) 0\n' done -- cgit v1.2.3