Mercurial > vim
comparison src/ex_docmd.c @ 30217:e0cb5fb44859 v9.0.0444
patch 9.0.0444: trying to declare g:variable gives confusing error
Commit: https://github.com/vim/vim/commit/9510d22463055f56548ff461ccbc54caa1ba1a2f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 11 15:14:05 2022 +0100
patch 9.0.0444: trying to declare g:variable gives confusing error
Problem: Trying to declare g:variable gives confusing error.
Solution: Give a better error message. (closes https://github.com/vim/vim/issues/11108)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 11 Sep 2022 16:15:04 +0200 |
parents | 3564cddda2a5 |
children | 121d28008c14 |
comparison
equal
deleted
inserted
replaced
30216:cafa3e83fdde | 30217:e0cb5fb44859 |
---|---|
3759 eap->cmdidx = CMD_var; | 3759 eap->cmdidx = CMD_var; |
3760 return eap->cmd; | 3760 return eap->cmd; |
3761 } | 3761 } |
3762 } | 3762 } |
3763 | 3763 |
3764 // Recognize using a type for a w:, b:, t: or g: variable: | 3764 // Recognize trying to use a type for a w:, b:, t: or g: variable: |
3765 // "w:varname: number = 123". | 3765 // "w:varname: number = 123". |
3766 if (eap->cmd[1] == ':' && *p == ':') | 3766 if (eap->cmd[1] == ':' && *p == ':') |
3767 { | 3767 { |
3768 eap->cmdidx = CMD_eval; | 3768 eap->cmdidx = CMD_var; |
3769 return eap->cmd; | 3769 return eap->cmd; |
3770 } | 3770 } |
3771 } | 3771 } |
3772 | 3772 |
3773 // 1234->func() is a method call | 3773 // 1234->func() is a method call |