ishan9299 / modus-theme-vim

Port of modus-themes in neovim
MIT License
160 stars 10 forks source link

Error when trying to set colorscheme in neovim v0.4.4 #4

Closed jakesco closed 3 years ago

jakesco commented 3 years ago

Hi there,

While attempting to set the theme with colorscheme modus-vivendi I get the following error:

Error detected while processing 
/home/<redacted>/.local/share/nvim/site/plugged/modus-theme-vim/colors/modus-vivendi.vim: 
line 2: 
E5105: Error while calling lua chunk: 
.../nvim/site/plugged/modus-theme-vim/lua/modus-vivendi.lua:7: attempt to call field 'cmd' (a nil value)

I use vim-plug and installed colorbuddy as directed in the README.

ishan9299 commented 3 years ago

It seems that the problem was that I was using the wrappers around vim.api functions and those are available in the nightly version. It will fixed soon thanks for opening the issue.

ishan9299 commented 3 years ago

It should be fixed now. Please update the colorscheme.

ishan9299 commented 3 years ago

Sorry I made a mistake in the commit d0df9f34bf07b076f0f4fcc43beaae4e9d93b22e it should be fixed now 571bff557208f7364f5bf717140b3c08fe204cc3.

jakesco commented 3 years ago

Thank you so much!

I updated and now get this error:

line    2:
E5105: Error while calling lua chunk: .../nvim/site/plugged/modus-theme-vim/lua/modus-vivendi.lua:13: attempt to index field 'fn' (a nil value)

I was able to get it working for now by commenting out

if vim.fn.exists('syntax_on') then
  vim.api.nvim_command('syntax reset')
end

and

local flag = vim.fn.exists('g:modus_faint_syntax')
if flag == 0 then
  vim.api.nvim_set_var('modus_faint_syntax', 0)
end
local faint = vim.api.nvim_get_var('modus_faint_syntax')
ishan9299 commented 3 years ago

It seems lua is a bit hit or miss for 0.4.4 I have moved some parts of code to vimscript so that you won't get errors. But now to apply the colorscheme you will have to use lua require('colorbuddy').colorscheme('modus-operandi')

jakesco commented 3 years ago

The update is working.

Thanks for working on this!