nanozuki / tabby.nvim

A declarative, highly configurable, and neovim style tabline plugin. Use your nvim tabs as a workspace multiplexer!
MIT License
570 stars 20 forks source link

[Bug] Not finding tabby modules #64

Closed luiz00martins closed 2 years ago

luiz00martins commented 2 years ago

Upon running require('tabby.filename') and require('tabby.util'), I get the errors module 'tabby.filename' not found and module 'tabby.util' not found.

Is that a bug or were they removed?

nanozuki commented 2 years ago

It was never removed, can you check your plugins manager?

luiz00martins commented 2 years ago

I ran a :PackerSync, and the problem disappeared... despite having no new commits from tabby

:|

luiz00martins commented 2 years ago

Just reinstalled my OS, and it came back after the fresh install. Suspecting it's something specific to my setup.

Gonna try to take some time to debug it this week.

nanozuki commented 2 years ago

For the nvim lua environment, the module tabby.filename is in /lua/tabby/filename.lua, and the module tabby.util is in /lua/tabby/util.lua.

So, this can't be an issue in tabby.nvim, please check the usage of the plugin manager. I'll close the issue, but we can also discuss this issue.

Btw, won't forget to call PackerCompile when you change packer's config.

luiz00martins commented 2 years ago

Ultimately, the problem happened because I had an after clause:

use {
    'nanozuki/tabby.nvim',
    after = 'tokyonight.nvim',
}

That deferred tabby's execution so much, that when I manually called require('tabby.filename') later in my config, tabby wasn't loaded yet. (that's my best guess at least)

Removing the after clause and reinstalling tabby solved the problem.

nanozuki commented 2 years ago

As I mentioned, If you use pakcer.nvim, the best way to config the plugin is to put your plugin config in plugin declaration. Like this:

use {
  'nanozuki/tabby.nvim',
  config = function()
    require('tabby').setup({})
  end
}
luiz00martins commented 2 years ago

I've had some issues with config in the past, so I opted out of it. Just decided to try it out again though, and it seems like it's working normally, so I'll use it in my configs. Thanks.