Mercurial > vim
comparison runtime/doc/eval.txt @ 15219:dada0b389d4f v8.1.0619
patch 8.1.0619: :echomsg and :echoerr do not handle List and Dict
commit https://github.com/vim/vim/commit/461a7fcfce3cd6414f990037e6468af3b5ccf119
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 22 13:28:07 2018 +0100
patch 8.1.0619: :echomsg and :echoerr do not handle List and Dict
Problem: :echomsg and :echoerr do not handle List and Dict like :echo does.
(Daniel Hahler)
Solution: Be more tolerant about the expression result type.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 22 Dec 2018 13:30:08 +0100 |
parents | 3a99b2e6d136 |
children | 17525ca95e1e |
comparison
equal
deleted
inserted
replaced
15218:d8a6097d1f52 | 15219:dada0b389d4f |
---|---|
9231 instead. | 9231 instead. |
9232 This is only meant to be used in tests, where catching the | 9232 This is only meant to be used in tests, where catching the |
9233 error with try/catch cannot be used (because it skips over | 9233 error with try/catch cannot be used (because it skips over |
9234 following code). | 9234 following code). |
9235 {expr} is used literally, not as a pattern. | 9235 {expr} is used literally, not as a pattern. |
9236 There is currently no way to revert this. | 9236 When the {expr} is the string "RESET" then the list of ignored |
9237 errors is made empty. | |
9237 | 9238 |
9238 test_null_channel() *test_null_channel()* | 9239 test_null_channel() *test_null_channel()* |
9239 Return a Channel that is null. Only useful for testing. | 9240 Return a Channel that is null. Only useful for testing. |
9240 {only available when compiled with the +channel feature} | 9241 {only available when compiled with the +channel feature} |
9241 | 9242 |
10997 |:echo| command. But unprintable characters are | 10998 |:echo| command. But unprintable characters are |
10998 displayed, not interpreted. | 10999 displayed, not interpreted. |
10999 The parsing works slightly different from |:echo|, | 11000 The parsing works slightly different from |:echo|, |
11000 more like |:execute|. All the expressions are first | 11001 more like |:execute|. All the expressions are first |
11001 evaluated and concatenated before echoing anything. | 11002 evaluated and concatenated before echoing anything. |
11002 The expressions must evaluate to a Number or String, a | 11003 If expressions does not evaluate to a Number or |
11003 Dictionary or List causes an error. | 11004 String, string() is used to turn it into a string. |
11004 Uses the highlighting set by the |:echohl| command. | 11005 Uses the highlighting set by the |:echohl| command. |
11005 Example: > | 11006 Example: > |
11006 :echomsg "It's a Zizzer Zazzer Zuzz, as you can plainly see." | 11007 :echomsg "It's a Zizzer Zazzer Zuzz, as you can plainly see." |
11007 < See |:echo-redraw| to avoid the message disappearing | 11008 < See |:echo-redraw| to avoid the message disappearing |
11008 when the screen is redrawn. | 11009 when the screen is redrawn. |
11009 *:echoe* *:echoerr* | 11010 *:echoe* *:echoerr* |
11010 :echoe[rr] {expr1} .. Echo the expression(s) as an error message, saving the | 11011 :echoe[rr] {expr1} .. Echo the expression(s) as an error message, saving the |
11011 message in the |message-history|. When used in a | 11012 message in the |message-history|. When used in a |
11012 script or function the line number will be added. | 11013 script or function the line number will be added. |
11013 Spaces are placed between the arguments as with the | 11014 Spaces are placed between the arguments as with the |
11014 :echo command. When used inside a try conditional, | 11015 |:echomsg| command. When used inside a try conditional, |
11015 the message is raised as an error exception instead | 11016 the message is raised as an error exception instead |
11016 (see |try-echoerr|). | 11017 (see |try-echoerr|). |
11017 Example: > | 11018 Example: > |
11018 :echoerr "This script just failed!" | 11019 :echoerr "This script just failed!" |
11019 < If you just want a highlighted message use |:echohl|. | 11020 < If you just want a highlighted message use |:echohl|. |