Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VimL: get/set multibyte environment variable names #9665

Open
erw7 opened this issue Mar 3, 2019 · 3 comments
Open

VimL: get/set multibyte environment variable names #9665

erw7 opened this issue Mar 3, 2019 · 3 comments
Labels
bug-vim wrong behavior inherited from vim encoding system vimscript
Milestone

Comments

@erw7
Copy link
Contributor

erw7 commented Mar 3, 2019

  • nvim --version: NVIM v0.4.0-246-g1694f445e
  • Vim (version: ) behaves differently?
    • In Windows vim, if I complement the variable name, I can display that value with echo.
    • It is the same as neovim in Linux vim.
    • In Windows and Linux, vim can not set variables with let same as neovim.
  • Operating system/version: Microsoft Windows [Version 6.1.7601]
  • Terminal name/version: cmd.exe
  • $TERM: win32con

Steps to reproduce using nvim -u NORC

chcp 932
set aあ=abc
nvim -u NORC
:echo $aあ
or
:let $iい='abc'

Actual behaviour

It is displayed as follows.

E15: Invalid expression: <81><82>
or
E15: Invalid expression: $iい='abc'
E488: Trailing characters

Expected behaviour

I understand that this will be the specification of vim script. I also understand that few people use multibyte for environment variable names. I do not know if we need to fix it to be honest. However, it is preferable to be able to deal with it unless it is prohibited to include multibyte in environment variable names.

@justinmk
Copy link
Member

justinmk commented Mar 3, 2019

:echo $aあ works in Windows Vim?

Does this work in Nvim on Windows:

:echo expand('$aあ')

On linux I see this in bash:

$ export 'XTEST_1AaあB'=foo
-bash: export: `XTEST_1AaあB=foo': not a valid identifier

@justinmk justinmk added this to the unplanned milestone Mar 3, 2019
@justinmk justinmk changed the title Can't use multibyte characters for environment variable names VimL: get/set multibyte environment variable names Mar 3, 2019
@erw7
Copy link
Contributor Author

erw7 commented Mar 3, 2019

It is very strange, but if I enter the variable name by completion in the next step, it will work with Windows vim. And if I enter $aあ from the keyboard, nothing is displayed.

vim -u NONE -N
:echo $a<tab>

It is as follows in zsh:

$ export 'XTEST_1AaあB'=foo
$ echo XTEST_1AaあB
foo

Even tcsh and fish can use multibyte for environment variable names.

@erw7
Copy link
Contributor Author

erw7 commented Mar 3, 2019

Does this work in Nvim on Windows:

No, $aあ is displayed.

@justinmk justinmk added the bug-vim wrong behavior inherited from vim label Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-vim wrong behavior inherited from vim encoding system vimscript
Projects
None yet
Development

No branches or pull requests

2 participants