Mercurial > vim
comparison src/message.c @ 9436:f048e5a27253 v7.4.1999
commit https://github.com/vim/vim/commit/bc5d6dd1dd1dc3a06e4e655fc9479529db288365
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 7 23:04:18 2016 +0200
patch 7.4.1999
Problem: evalcmd() doesn't work recursively.
Solution: Use redir_evalcmd instead of redir_vname.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 07 Jul 2016 23:15:05 +0200 |
parents | 32e34e574716 |
children | 9da0cb39cbee |
comparison
equal
deleted
inserted
replaced
9435:eb1692f10ce6 | 9436:f048e5a27253 |
---|---|
3061 if (*s != '\n' && *s != '\r') | 3061 if (*s != '\n' && *s != '\r') |
3062 { | 3062 { |
3063 while (cur_col < msg_col) | 3063 while (cur_col < msg_col) |
3064 { | 3064 { |
3065 #ifdef FEAT_EVAL | 3065 #ifdef FEAT_EVAL |
3066 if (redir_reg) | 3066 if (redir_evalcmd) |
3067 evalcmd_redir_str((char_u *)" ", -1); | |
3068 else if (redir_reg) | |
3067 write_reg_contents(redir_reg, (char_u *)" ", -1, TRUE); | 3069 write_reg_contents(redir_reg, (char_u *)" ", -1, TRUE); |
3068 else if (redir_vname) | 3070 else if (redir_vname) |
3069 var_redir_str((char_u *)" ", -1); | 3071 var_redir_str((char_u *)" ", -1); |
3070 else | 3072 else |
3071 #endif | 3073 #endif |
3076 ++cur_col; | 3078 ++cur_col; |
3077 } | 3079 } |
3078 } | 3080 } |
3079 | 3081 |
3080 #ifdef FEAT_EVAL | 3082 #ifdef FEAT_EVAL |
3081 if (redir_reg) | 3083 if (redir_evalcmd) |
3084 evalcmd_redir_str(s, maxlen); | |
3085 else if (redir_reg) | |
3082 write_reg_contents(redir_reg, s, maxlen, TRUE); | 3086 write_reg_contents(redir_reg, s, maxlen, TRUE); |
3083 if (redir_vname) | 3087 else if (redir_vname) |
3084 var_redir_str(s, maxlen); | 3088 var_redir_str(s, maxlen); |
3085 #endif | 3089 #endif |
3086 | 3090 |
3087 /* Write and adjust the current column. */ | 3091 /* Write and adjust the current column. */ |
3088 while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen)) | 3092 while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen)) |
3089 { | 3093 { |
3090 #ifdef FEAT_EVAL | 3094 #ifdef FEAT_EVAL |
3091 if (!redir_reg && !redir_vname) | 3095 if (!redir_reg && !redir_vname && !redir_evalcmd) |
3092 #endif | 3096 #endif |
3093 if (redir_fd != NULL) | 3097 if (redir_fd != NULL) |
3094 putc(*s, redir_fd); | 3098 putc(*s, redir_fd); |
3095 if (verbose_fd != NULL) | 3099 if (verbose_fd != NULL) |
3096 putc(*s, verbose_fd); | 3100 putc(*s, verbose_fd); |
3111 int | 3115 int |
3112 redirecting(void) | 3116 redirecting(void) |
3113 { | 3117 { |
3114 return redir_fd != NULL || *p_vfile != NUL | 3118 return redir_fd != NULL || *p_vfile != NUL |
3115 #ifdef FEAT_EVAL | 3119 #ifdef FEAT_EVAL |
3116 || redir_reg || redir_vname | 3120 || redir_reg || redir_vname || redir_evalcmd |
3117 #endif | 3121 #endif |
3118 ; | 3122 ; |
3119 } | 3123 } |
3120 | 3124 |
3121 /* | 3125 /* |