Coder Social home page Coder Social logo

Comments (5)

tamago324 avatar tamago324 commented on July 17, 2024

Thanks for the report.
Please indicate the version of neovim and the detailed reproduction procedure.

from lir.nvim.

ten3roberts avatar ten3roberts commented on July 17, 2024

image
Use lir.float.init

Use actions.up through keybind and a new window will open behind.

I think the issue is due to this

actions.quit()
vim.cmd(cmd .. " " .. filename)

The expected behaviour is to open in the floating window

from lir.nvim.

ten3roberts avatar ten3roberts commented on July 17, 2024

NVIM v0.7.0-dev+997-g21cdecc8e, but is present in newer versions on another computer

from lir.nvim.

tamago324 avatar tamago324 commented on July 17, 2024

I have performed the following steps and it is working fine, can you please try?

  1. nvim -u minvimrc -i NONE
  2. :lua require'lir.float'.init()
  3. press l, press h

Neovim version: NVIM v0.7.0-dev+1115-g5cb45dffb

minvimrc
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 'kyazdani42/nvim-web-devicons'
Plug 'nvim-lua/plenary.nvim'
Plug 'tamago324/lir.nvim'
call plug#end()

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

" nvim -u ~/ghq/github.com/tamago324/sandbox-vim/nvim/lir.vim -i NONE

lua << EOF

local actions = require'lir.actions'
local mark_actions = require 'lir.mark.actions'
local clipboard_actions = require'lir.clipboard.actions'

require'lir'.setup {
  show_hidden_files = false,
  devicons_enable = true,
  mappings = {
    ['l']     = actions.edit,
    ['<C-s>'] = actions.split,
    ['<C-v>'] = actions.vsplit,
    ['<C-t>'] = actions.tabedit,

    ['h']     = actions.up,
    ['q']     = actions.quit,

    ['K']     = actions.mkdir,
    ['N']     = actions.newfile,
    ['R']     = actions.rename,
    ['@']     = actions.cd,
    ['Y']     = actions.yank_path,
    ['.']     = actions.toggle_show_hidden,
    ['D']     = actions.delete,

    ['J'] = function()
      mark_actions.toggle_mark()
      vim.cmd('normal! j')
    end,
    ['C'] = clipboard_actions.copy,
    ['X'] = clipboard_actions.cut,
    ['P'] = clipboard_actions.paste,
  },
  float = {
    winblend = 0,
    curdir_window = {
      enable = false,
      highlight_dirname = false
    },

    -- -- 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.8)
    --   local height = math.floor(vim.o.lines * 0.8)
    --   return {
    --     border = require("lir.float.helper").make_border_opts({
    --       "+", "", "+", "", "+", "", "+", "",
    --     }, "Normal"),
    --     width = width,
    --     height = height,
    --     row = 1,
    --     col = math.floor((vim.o.columns - width) / 2),
    --   }
    -- end,
  },
  hide_cursor = true,
  on_init = function()
    -- use visual mode
    vim.api.nvim_buf_set_keymap(
      0,
      "x",
      "J",
      ':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>',
      { noremap = true, silent = true }
    )

    -- echo cwd
    vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {})
  end,
}

-- custom folder icon
require'nvim-web-devicons'.set_icon({
  lir_folder_icon = {
    icon = "",
    color = "#7ebae4",
    name = "LirFolderNode"
  }
})


EOF

from lir.nvim.

ten3roberts avatar ten3roberts commented on July 17, 2024

I am sorry for taking such a while to respond, hectic week with exams.

Anyways, I found the culprit

The plugin stickybuf prevented the new buffer from opening. The plugins purpose is to prevent files from opening in tree view buffers.

Removing the plugin fixes the issue, though it enables one to open files inside tree windows, which isn't such a big issue.

Just out of curiosity:
Is it possible to set the ctx.dir and have it update without reloading the file manager using edit dir. I didn't get the first method to work in my small attempts, maybe something like that could be used to prevent firing more autocommands from other plugins

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.