dstein64 / nvim-scrollview

A Neovim plugin that displays interactive vertical scrollbars and signs.
MIT License
517 stars 9 forks source link

Fix wrong vimscript function return value judgment #125

Closed ofseed closed 7 months ago

ofseed commented 7 months ago

The vimscript function bufexists will return 0 for v:false and 1 for v:true, and 0 is considered true in Lua. This is often an overlooked mistake.

dstein64 commented 7 months ago

Thanks for the bug fix @ofseed.

In e8d35d08e1ac3f08d418c38de1d30b681c0f678e, I switched the equality check to instead use to_bool, a utility function that I've used for this type of scenario.

I also added the same type of fix to coc.lua (1b11329ece4cd25884b56c129aedc23ff1665d92).