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

Error when toggling Atraxis mode #141

Open
serialized-kirin opened this issue Aug 15, 2024 · 3 comments
Open

Error when toggling Atraxis mode #141

serialized-kirin opened this issue Aug 15, 2024 · 3 comments

Comments

@serialized-kirin
Copy link

I'm getting an error when toggling Atraxis mode using :lua require("true-zen.ataraxis").toggle():

E5108: Error executing lua .../pack/deps/opt/true-zen.nvim/lua/true-zen/minimalist.lua:118: Invalid value for 
option 'showmode': expected boolean, got number 0                                                             
stack traceback:                                                                                              
        [C]: in function '__newindex'                                                                         
        .../pack/deps/opt/true-zen.nvim/lua/true-zen/minimalist.lua:118: in function 'off'                    
        ...te/pack/deps/opt/true-zen.nvim/lua/true-zen/ataraxis.lua:252: in function 'off'                    
        ...te/pack/deps/opt/true-zen.nvim/lua/true-zen/ataraxis.lua:291: in function 'toggle'                 
        [string ":lua"]:1: in main chunk                                                                      
Press ENTER or type command to continue

It does successfully toggle off, but it does not change the running state, so trying to toggle it back on doesn't work after toggling it off.

After a little of digging, i think it's because gettabwinvar is used to get the option values (minimalist.lua:58), but the options are set using vim.o, so i think that's probably it? Also for some context I set noshowmode in my init.lua.
I've fixed the problem for me, but like it feels hacky and I only know the problems I ended up encountering ofc but ye I just was left with this instead of the line on minimalist.lua:188:

            -- o[k] = v
            if type(v) == 'boolean' and type(o[k]) == 'number' then -- error about showmode
                o[k] = v and 1 or 0
            elseif type(v) == 'boolean' and type(o[k]) == 'string' then -- error about signcolumn
                o[k] = v and 'on' or 'off' -- v and 'yes' or 'no'
            end
@agaro1121
Copy link

I've also run into this issue and it looks like there is a similar issue in #125

agaro1121 pushed a commit to agaro1121/true-zen.nvim that referenced this issue Aug 22, 2024
@agaro1121
Copy link

I ended up forking the plugin and using your suggestion @serialized-kirin
Thank you. It seems to be working so far.

@ricarvid1
Copy link

I'm having the same issue here.

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

No branches or pull requests

3 participants