Coder Social home page Coder Social logo

Comments (7)

tamago324 avatar tamago324 commented on August 16, 2024

I would like to fix this if possible, but I don't understand what you are saying. (This is because I am not used to reading and writing English. Sorry.) I'm sorry, but is it possible to see the code?

from lir.nvim.

ispringle avatar ispringle commented on August 16, 2024

Yes, sorry for the delay! This is your mini vimrc you've referrenced in #50 but I added the defer_fn. In fact... I seem to recall when I removed loading lir in the defer_fn it resolved the issue I was seeing in #50

set encoding=utf-8

filetype plugin indent on
if has('vim_starting')
  let s:pluin_manager_dir='~/.config/nvim/.plugged/vim-plug'
  execute 'set runtimepath+=' . s:pluin_manager_dir
endif
call plug#begin('~/.config/nvim/.plugged')
Plug 'tamago324/lir.nvim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'nvim-lua/plenary.nvim'
call plug#end()

set nobackup
set nowritebackup
set noswapfile
set updatecount=0
set backspace=indent,eol,start
language messages en_US.utf8

lua << EOF
vim.defer_fn(function()
local actions = require'lir.actions'

require'lir'.setup {
  show_hidden_files = false,
  devicons_enable = true,
  mappings = {
    ['l']     = actions.edit,
    ['h']     = actions.up,
    ['q']     = actions.quit,
  },
  float = {
    winblend = 0,
    curdir_window = {
      enable = true,
      highlight_dirname = true,
    },

    -- You can define a function that returns a table to be passed as the third
    -- argument of nvim_open_win().
    win_opts = function()
      local width = math.floor(vim.o.columns * 0.5)
      local height = math.floor(vim.o.lines * 0.5)

      return {
        border = 'single',
        -- border = require("lir.float.helper").make_border_opts({
        --   "+",
        --   "─",
        --   "+",
        --   "│",
        --   "+",
        --   "─",
        --   "+",
        --   "│",
        -- }, "Normal"),
        width = width,
        height = height,
      }
    end,
  },
  hide_cursor = true,
}

vim.cmd [[augroup lir-settings]]
vim.cmd [[  autocmd!]]
vim.cmd [[  autocmd Filetype lir :lua LirSettings()]]
vim.cmd [[augroup END]]

vim.api.nvim_set_keymap(
  "n",
  "<C-e>",
  "<Cmd>lua require'lir.float'.toggle()<CR>",
  { silent = true, noremap = true }
)
end)
EOF```

from lir.nvim.

tamago324 avatar tamago324 commented on August 16, 2024

I'm sorry if I'm wrong, but I think defer_fn needs a second argument, but the above vimrc doesn't specify a second argument. If I add the second argument as in defer_fn(function() ... end, 10), the error disappears.

However, with the above vimrc, I get an error like #50. I don't know why. I'm in trouble.

from lir.nvim.

ispringle avatar ispringle commented on August 16, 2024

You're right. I removed the defer_fn from my init.lua. My previous config with the defer_fn was using a value of 0. Maybe it was something else not playing nicely with lir. I'll do further digging. I am getting some other odd behaviors so perhaps there is a problem still and I just removed an immediate means of bringing it to my attention...

from lir.nvim.

tamago324 avatar tamago324 commented on August 16, 2024

Thank you very much. If you find out anything, please let me know.

from lir.nvim.

ispringle avatar ispringle commented on August 16, 2024

I'm closing this issue. I swapped to packer from paq and I can now use the fn_defer and the other issues are all gone as well. I'm going to assume it was something to do with how packadd was being called...?

from lir.nvim.

tamago324 avatar tamago324 commented on August 16, 2024

I don't know the cause, but I'm glad it seems to have been resolved anyway.
Thank you for the report.

from lir.nvim.

Related Issues (20)

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.