summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-05-17 18:23:09 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-05-17 18:23:09 +0000
commita4106e0523036bff9eb1556629bd44a359444d93 (patch)
tree0bb6abc51e4b71b1cf75e69dc3d7b678976e4ae4
parent9169cd747f81bf1053e4d230ef1efdfd5aedb642 (diff)
downloadzsh-a4106e0523036bff9eb1556629bd44a359444d93.tar.gz
zsh-a4106e0523036bff9eb1556629bd44a359444d93.zip
Greg Klanderman: 26964 (modified): PROMPT_EOL_MARK
-rw-r--r--ChangeLog10
-rw-r--r--Completion/Unix/Command/_subversion5
-rw-r--r--Doc/Zsh/options.yo12
-rw-r--r--Doc/Zsh/params.yo12
-rw-r--r--Src/utils.c10
5 files changed, 35 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 05ec1be24..19b1d3765 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-05-17 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * Greg Klanderman: 26964 (modified): Src/utils.c,
+ Doc/zsh/options.yo, Doc/Zsh/params.yo: make prompt
+ end-of-line configurable with PROMPT_EOL_MARK.
+
+ * Greg Klanderman: 26963: fix suffix handling for svn completion
+
2009-05-16 Peter Stephenson <p.w.stephenson@ntlworld.com>
* Paul Ackersviller: 26962: configure.ac, aczsh.m4,
@@ -11716,5 +11724,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4687 $
+* $Revision: 1.4688 $
*****************************************************
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 9f137fffd..01b2bbb2a 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -215,9 +215,8 @@ _svn_urls() {
_tags files
while _tags; do
while _next_label files expl ${suf:-directory}; do
- [[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf $remdispf && ret=0
- compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \
- ${remdispd%/} && ret=0
+ [[ -n $suf ]] && compadd -S ' ' -q "$@" "$expl[@]" -d remdispf $remdispf && ret=0
+ compadd -S "${suf:+/}" -q "$@" "$expl[@]" -d remdispd ${remdispd%/} && ret=0
done
(( ret )) || return 0
done
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 0a03c8272..c9e9b7be5 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -1307,16 +1307,18 @@ cindex(prompt, save partial lines)
item(tt(PROMPT_SP) <D>)(
Attempt to preserve a partial line (i.e. a line that did not end with a
newline) that would otherwise be covered up by the command prompt due to
-the PROMPT_CR option. This works by outputting some cursor-control
+the tt(PROMPT_CR) option. This works by outputting some cursor-control
characters, including a series of spaces, that should make the terminal
wrap to the next line when a partial line is present (note that this is
only successful if your terminal has automatic margins, which is typical).
-When a partial line is preserved, you will see an inverse+bold character at
-the end of the partial line: a "%" for a normal user or a "#" for root.
+When a partial line is preserved, by default you will see an inverse+bold
+character at the end of the partial line: a "%" for a normal user or
+a "#" for root. If set, the shell parameter tt(PROMPT_EOL_MARK) can be
+used to customize how the end of partial lines are shown.
-NOTE: if the PROMPT_CR option is not set, enabling this option will have no
-effect. This option is on by default.
+NOTE: if the tt(PROMPT_CR) option is not set, enabling this option will
+have no effect. This option is on by default.
)
pindex(PROMPT_PERCENT)
pindex(NO_PROMPT_PERCENT)
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index e36becf53..f77d36db4 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -1043,13 +1043,21 @@ vindex(prompt)
item(tt(prompt) <S> <Z>)(
Same as tt(PS1).
)
+vindex(PROMPT_EOL_MARK)
+item(tt(PROMPT_EOL_MARK))(
+When the tt(PROMPT_CR) and tt(PROMPT_SP) options are set, the
+tt(PROMPT_EOL_MARK) parameter can be used to customize how the end of
+partial lines are shown. This parameter undergoes prompt expansion, with
+the tt(PROMPT_PERCENT) option set. If not set or empty, the default
+behavior is equivalent to the value `tt(%B%S%#%s%b)'.
+)
vindex(PS1)
item(tt(PS1) <S>)(
The primary prompt string, printed before a command is read.
-the default is `tt(%m%# )'. It undergoes a special form of expansion
+It undergoes a special form of expansion
before being displayed; see
ifzman(EXPANSION OF PROMPT SEQUENCES in zmanref(zshmisc))\
-ifnzman(noderef(Prompt Expansion)).
+ifnzman(noderef(Prompt Expansion)). The default is `tt(%m%# )'.
)
vindex(PS2)
item(tt(PS2) <S>)(
diff --git a/Src/utils.c b/Src/utils.c
index d259827a9..d30dacca8 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1216,12 +1216,16 @@ preprompt(void)
* Unfortunately it interacts badly with ZLE displaying message
* when ^D has been pressed. So just disable PROMPT_SP logic in
* this case */
+ char *eolmark = getsparam("PROMPT_EOL_MARK");
char *str;
- int percents = opts[PROMPTPERCENT];
+ int percents = opts[PROMPTPERCENT], w = 0;
+ if (!eolmark || !*eolmark)
+ eolmark = "%B%S%#%s%b";
opts[PROMPTPERCENT] = 1;
- str = promptexpand("%B%S%#%s%b", 0, NULL, NULL, NULL);
+ str = promptexpand(eolmark, 1, NULL, NULL, NULL);
+ countprompt(str, &w, 0, -1);
opts[PROMPTPERCENT] = percents;
- fprintf(shout, "%s%*s\r", str, (int)columns - 1 - !hasxn, "");
+ fprintf(shout, "%s%*s\r", str, (int)columns - w - !hasxn, "");
free(str);
}