pocco81 / true-zen.nvim

🦝 Clean and elegant distraction-free writing for NeoVim
GNU General Public License v3.0
973 stars 28 forks source link

Error with showtablines when toggling Ataraxis or Minimalist off #125

Open clockworkpc opened 7 months ago

clockworkpc commented 7 months ago

Neovim Config:

NVIM v0.10.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Installed the plugin with Lazy.nvim in NVChad:

  {
    'pocco81/true-zen.nvim', lazy = false
  }

GIVEN the above installation WHEN I enter any mode THEN everything works fine BUT WHEN I exit any mode THEN I get an error such as the following:

Error:

Error executing Lua callback: ...hare/nvim/lazy/true-zen.nvim/lua/true-zen/minimalist.lua:118: Invalid value for option 'showtabline': expected number, got boolean true
stack traceback:                                                                                                                                                                              
        [C]: in function '__newindex'                                                                                                                                                         
        ...hare/nvim/lazy/true-zen.nvim/lua/true-zen/minimalist.lua:118: in function 'off'                                                                                                    
        .../share/nvim/lazy/true-zen.nvim/lua/true-zen/ataraxis.lua:252: in function 'off'                                                                                                    
        .../share/nvim/lazy/true-zen.nvim/lua/true-zen/ataraxis.lua:291: in function 'toggle'                                                                                                 
        ...ocal/share/nvim/lazy/true-zen.nvim/lua/true-zen/init.lua:4: in function 'ataraxis'                                                                                                 
        .../local/share/nvim/lazy/true-zen.nvim/plugin/true-zen.lua:9: in function <.../local/share/nvim/lazy/true-zen.nvim/plugin/true-zen.lua:8>   

The stack trace always comes back to true-zen/minimalist.lua:118.

What is happening to showtablines in this loop?

clockworkpc commented 7 months ago

Update:

I disabled all of the minimalist options and can toggle Ataraxis mode without error:

        minimalist = {
            ignored_buf_types = { "nofile" }, -- save current options from any window except ones displaying these kinds of buffers
            options = { -- options to be disabled when entering Minimalist mode
                -- number = false,
                -- relativenumber = false,
                -- showtabline = 0,
                -- signcolumn = "no",
                -- statusline = "",
                -- cmdheight = 1,
                -- laststatus = 0,
                -- showcmd = false,
                -- showmode = false,
                -- ruler = false,
                -- numberwidth = 1
            },

This is what it looks like, not perfect but usable for me.

image

When all the options are enabled with default values, the error is this:

Error executing Lua callback: ...hare/nvim/lazy/true-zen.nvim/lua/true-zen/minimalist.lua:118: Invalid value for option 'showtabline': expected number, got boolean true

If I comment out showtabline, exit, re-open Neovim and try toggling Ataraxis on and then off:

...Invalid value for option 'ruler': expected boolean, got number 0

If I then comment out ruler, exit, re-open Neovim and try toggling Ataraxis on and then off:

...Invalid value for option 'cmdheight': expected number, got boolean true

If I then comment out cmdheight, exit, re-open Neovim and try toggling Ataraxis on and then off:

...Invalid value for option 'showmode': expected boolean, got number 0

If I then comment out showmode, exit, re-open Neovim and try toggling Ataraxis on and then off:

Then it works.

I have to disable the following options to get Ataraxis mode to work. As far as I can tell, if I enable any of the following, I get one of the above errors.

minimalist = {
    ignored_buf_types = { "nofile" }, -- save current options from any window except ones displaying these kinds of buffers
    options = { -- options to be disabled when entering Minimalist mode
        number = false,
        relativenumber = false,
        -- showtabline = 0,
        signcolumn = "no",
        statusline = "",
        -- cmdheight = 1,
        laststatus = 0,
        showcmd = false,
        -- showmode = false,
        -- ruler = false,
        numberwidth = 1
    },
EJunger commented 7 months ago

Having the same issue, however amending the minimalist options doesn't seem to have helped. I can enter ataraxis but zen crashes when I try to exit.

Qkessler commented 3 months ago

Hi there! Any update on this ticket? Would be happy to get it fixed!

joshuadanpeterson commented 3 months ago

Just set this up today and started seeing this exact error. Glad I'm not the only one. Hopefully it gets fixed. Tried @clockworkpc's solution, but that didn't work for me either. Looks like I'm going to have to switch to Zen Mode until this gets fixed.