ap / vim-css-color

Preview colours in source code while editing
http://www.vim.org/scripts/script.php?script_id=5056
MIT License
1.77k stars 78 forks source link

const is not available prior to vim 8.1 #156

Closed j-hui closed 3 years ago

j-hui commented 3 years ago

The const keyword is not available since 8.1.1539: https://github.com/vim/vim/pull/4541#issuecomment-502372033

This commit introduces them, and this plugin is no longer working on older versions of vim: https://github.com/ap/vim-css-color/commit/8bc0a26cb7839c180e27fc9166c2a3265927feff

Is there any way these can be changed to regular let definitions, or at least fall back to that if const is not available?

ap commented 3 years ago

Yes, absolutely. Sorry about that.

j-hui commented 3 years ago

no problem, thanks for the handy plugin!

jbylsma commented 3 years ago

I made #157 to help get this added in; I'm stuck dealing with Vim 7.4 on many servers.

The lockvar comes straight from Vim's updated documentation for const:

Similar to :let, but additionally lock the variable
after setting the value.  This is the same as locking
the variable with :lockvar just after :let, thus:
        :const x = 1
is equivalent to:
        :let x = 1
        :lockvar! x
ap commented 3 years ago

Sorry it took a week, fixed in 7337c35588e9027b516f80f03c3b9621a271e168. Share and enjoy 🙂