Code Monkey home page Code Monkey logo

Comments (4)

lljbash avatar lljbash commented on June 11, 2024 1

Thank you for your prompt attention to my issue.

In lua/cmp_tmux/source.lua,

local config = require('cmp.config')

requires cmp.setup to be called or you won't get anything valuable.

However, people like me may get used to write configures like

-- lazy.nvim
return {
  {
    "hrsh7th/nvim-cmp",
    event = "InsertEnter",
    dependencies = {
      ...
      "andersevenrud/cmp-tmux",
      ...
    },
    name = "cmp",
    config = function()
      ...
      local cmp = require("cmp")
      ...
      cmp.setup({
        ...
        sources = {
          ...
          {
            name = "tmux",
            option = {
              label = "",
              trigger_characters = {},
            },
          },
          ...
        },
        ...
      })
      ...
    end,
  },
}

where cmp.tmux config will be loaded before that setup.

I have spotted a few other issues (like #27) that could be for the same reason.

from cmp-tmux.

lljbash avatar lljbash commented on June 11, 2024 1

Actually I have found a workaround for this issue by not using option provided by your plugin:

  1. using { name = "tmux", keyword_length = 2, trigger_characters = {} } to configure trigger rules.
  2. using lspkind.cmp_format({ before = function()... to remove that label.

But I'm still interested in improving your plugin. There should be 2 approaches:

  1. lazy-initializing source
  2. adding a setup stage like uga-rosa/cmp-dictionary

I would suggest remove all redundant options which have already been provided by cmp and move the others into a setup stage.

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 11, 2024

mention this unexpected behaviour

Sorry, but I don't completely understand what you mean here. From what I can tell cmp-tmux registers itself just like other extensions for cmp.

Care to elaborate on this?

from cmp-tmux.

andersevenrud avatar andersevenrud commented on June 11, 2024

Aha! I actually use pretty much the same setup as you, but actually haven't noticed this!

I'm a little bit busy at the moment, so if you have something in mind that could solve this feel free to open a pull-request.

from cmp-tmux.

Related Issues (17)

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.