Code Monkey home page Code Monkey logo

Comments (21)

gegoune avatar gegoune commented on June 5, 2024 1

Yeah, sure, close away. :) Out of curiosity, were you able to reproduce my issue at all?

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024 1

Nope, I was not able to reproduce this :/

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

To me this seems like maybe the tmux plugin loads before compe, which is why there's a nil exception there. I'll look to see if maybe there's a lazy loading method that can be adapted here πŸ€”

from cmp-tmux.

gegoune avatar gegoune commented on June 5, 2024

I have also tried to put compe-tmux in opt/ to avoid premature load as I had the same suspicion.
I then initialised it with:

vim.cmd "packadd compe-tmux"                                  
require("compe").register_source("tmux", require "compe_tmux")

require("compe").setup { …}

but it resulted in the same error.

Then after switching order I did get it to work:

vim.cmd "packadd compe-tmux"                                  

require("compe").setup { …}
require("compe").register_source("tmux", require "compe_tmux")

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

I've looked at the extension API and some other sources and from what I can tell there's nothing wrong with my code.

It's a bit strange that registering the source manually like that makes it work, because I was under the impression that compe did this exact same thing under the hood.

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

I've added a condition to prevent this exception from happening for others trying the same thing. Seeing that you figured out to load things in the correct order I'm closing this issue.

from cmp-tmux.

gegoune avatar gegoune commented on June 5, 2024

FYI, I am still getting that error with latest versions of compe and compe-tmux on nvim-0.5

Error detected while processing /Users/<me>/.local/share/nvim/site/pack/packer/start/compe-tmux/after/plugin/compe_tmux.vim:
line    7:
E5108: Error executing lua ...vim/site/pack/packer/start/compe-tmux/lua/compe_tmux.lua:132: attempt to index field 'source' (a nil value)
Press ENTER or type command to continue

I have moved compe-tmux back to start/, removed both packadd and register_source() call.

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

Okay. I'll replicate your setup and get to the bottom of that one :D

from cmp-tmux.

gegoune avatar gegoune commented on June 5, 2024

Thank you. Please let me know if there is anything you would like me to try. Loving that extension so would like to help as much as I can.

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

Maybe you could create a minimum example to reproduce this ? :)

from cmp-tmux.

gegoune avatar gegoune commented on June 5, 2024

It's very interesting. I have tried to reproduce it with minimal rc, but couldn't. It just works as expected with that config:

local fn = vim.fn

local install_path = "/tmp/site/pack/packer/start/packer.nvim"

vim.opt.packpath = "/tmp/site/pack/packer"
vim.opt.runtimepath = install_path
vim.opt.runtimepath:append("/usr/local/Cellar/neovim/HEAD-f515bae/share/nvim/runtime")

if fn.empty(fn.glob(install_path)) > 0 then
	vim.api.nvim_command("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
end

vim.opt.termguicolors = true

require("packer").startup({
	function(use)
		use({ "wbthomason/packer.nvim" })
		use({ "hrsh7th/nvim-compe" })
		use({ "andersevenrud/compe-tmux" })
	end,
	config = { package_root = "/tmp/site/pack" },
})

require("compe").setup({
	source = {
		tmux = true,
	},
})

One difference I noticed is that in nvim instance running of minimal config file I do get …/{nvim-compe,compe-tmux}/after paths in runtimepath while they are not there in my regular config. I tried to append those paths at the top of my regular init.lua but it didn't make the load error go away.

vim.opt.runtimepath:append "~/.local/share/nvim/site/pack/packer/start/compe-tmux/after"
vim.opt.runtimepath:append "~/.local/share/nvim/site/pack/packer/start/nvim-compe/after"

and they actually do not appear in set runtimepath?'s output. I will keep on digging into my set up.

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

while they are not there in my regular config. I tried to append those paths at the top of my regular init.lua but it didn't make the load error go away.

That certainly is quite interesting.

I haven't run into any issues relating to runtimepath, however packpath gave such a headache when I switched to packer. Even though the values there were OK, I could not get packer to load. And after I somehow got that to work, plugins just launched with a bunch errors, which just suddenly went away on its own. I started from scratch in order to satisfy my curiosity and then it suddenly worked fine, with the exact same procedure as before πŸ€·β€β™‚οΈ

from cmp-tmux.

gegoune avatar gegoune commented on June 5, 2024

One more thing that might be worth mentioning that is different in minimal and my regular configs: compe' configuration location is in minimal rc, while in my config it is in after/plugin, so I assume loading order is to be looked at a bit more.

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

Any luck ? πŸ˜…

from cmp-tmux.

gegoune avatar gegoune commented on June 5, 2024

Hey, sorry, completely forgot about it and just kept my little opt/ and packadd workaround. :)

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

Ah, no worries.

I'm just doing a little cleanup of open issues in my repos, so I thought I'd give a poke. Maybe it's safe to close this issue ?

from cmp-tmux.

gegoune avatar gegoune commented on June 5, 2024

Have installed another (second, had yours only before) compe's extension. codybuell/compe-lbdb - for whatever reason I am not having the same issue with compe-lbdb. Just letting you know in case it could help somehow.

My Packer's configuration for those plugins is as such:

use { 'hrsh7th/nvim-compe', requires = { { 'andersevenrud/compe-tmux', opt = true }, { 'codybuell/compe-lbdb' } } }

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

Looked at how that extension is handling the configuration loading (which is what the source of the exception is) and it has some kind of reducer that does not has any error side effects.

Currently trying a similar approach.

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

Actually, I just decided to add another check into the configuration loading. Should take care of the problem once and for all...

from cmp-tmux.

gegoune avatar gegoune commented on June 5, 2024

And it does work now without my little work around! I am glad I thought of letting you know! Sorry for pinging you in closed issue and thanks for both great plugin and fixing my issue!

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 5, 2024

No worries! Thanks for chiming in.

Would love to get to get to the bottom of this stiff though, heh. The only thing I can think of is that compe-tmux somehow is loaded twice, and once too early which leads to this exception. Technically it shouldn't because the Lua module system (i.e. require) is cached 🀷

But at least there's no more error.

from cmp-tmux.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.