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

Lua error when using configuration options #29

Closed
dswij opened this issue Jul 14, 2021 · 9 comments · Fixed by #59
Closed

Lua error when using configuration options #29

dswij opened this issue Jul 14, 2021 · 9 comments · Fixed by #59

Comments

@dswij
Copy link

dswij commented Jul 14, 2021

On init.vim after installing the plugin:

lua << EOF
require('github-theme').setup({
  themeStyle = "dimmed",
})
EOF

returns an error

E5108: Error executing lua ...im/plugged/github-nvim-theme/lua/github-theme/config.lua:33: attempt to
concatenate global 'vim' (a table value)

Using a minimal neovim config also returns a similar error.


For the context, this works fine

lua << EOF
require('github-theme').setup({})
EOF
@ful1e5
Copy link
Member

ful1e5 commented Jul 16, 2021

Are you using nvim >= 0.5?

@dswij
Copy link
Author

dswij commented Jul 16, 2021

Yes, using neovim 0.5

@ful1e5
Copy link
Member

ful1e5 commented Jul 18, 2021

Can you able to share the nvim config?

@dswij
Copy link
Author

dswij commented Jul 19, 2021

Here is the minimal nvim config:

call plug#begin('~/.vim/plugged')
Plug 'projekt0n/github-nvim-theme'
call plug#end()

lua << EOF
require('github-theme').setup({
  themeStyle = 'dimmed'
})
EOF

running nvim -v returns:

NVIM v0.5.0
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/build/config -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/src -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/build/src/nvim/auto -I/tmp/neovim-20210702-14987-rep9di/neovim-0.5.0/build/include
Compiled by brew@BigSur

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.5.0/share/nvim"

Run :checkhealth for more info

ful1e5 added a commit to ful1e5/github-nvim-theme that referenced this issue Jul 21, 2021
@ful1e5
Copy link
Member

ful1e5 commented Jul 21, 2021

I tried your config with nvim-nightly. It's working fine. I tweaked the way to assign global variables on my fork. Give it a try.

call plug#begin('~/.vim/plugged')
Plug 'ful1e5/github-nvim-theme', { 'branch': 'refactor/config.lua' }
call plug#end()

lua << EOF
require('github-theme').setup({
  themeStyle = 'dimmed'
})
EOF

@dswij
Copy link
Author

dswij commented Jul 21, 2021

lt changes the theme without error now, but I noticed it overwrites some configs that are declared before it.

@ful1e5
Copy link
Member

ful1e5 commented Aug 9, 2021

lt changes the theme without error now, but I noticed it overwrites some configs that are declared before it.

That configs are related to github-nvim-theme?

@ful1e5
Copy link
Member

ful1e5 commented Aug 16, 2021

I pushed 9fe4e90 on ful1e5/github-nvim-theme . give it try.

@dswij
Copy link
Author

dswij commented Aug 16, 2021

Sorry, just had time to look into this again.

I pushed 9fe4e90 on ful1e5/github-nvim-theme . give it try.

This seems to work perfectly fine now! Thanks for this! 🎉

ful1e5 added a commit to ful1e5/github-nvim-theme that referenced this issue Aug 17, 2021
ful1e5 added a commit that referenced this issue Aug 17, 2021
 fixed #29: refactored lua/github-theme/config.lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants