Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fern buffer is broken when I invoke <Plug>(fern-aciton-open:vsplit) #413

Closed
asmka opened this issue Apr 5, 2022 · 3 comments · Fixed by #414
Closed

Fern buffer is broken when I invoke <Plug>(fern-aciton-open:vsplit) #413

asmka opened this issue Apr 5, 2022 · 3 comments · Fixed by #414
Labels
bug Something isn't working

Comments

@asmka
Copy link

asmka commented Apr 5, 2022

Description

Fern buffer is broken when I invoke <Plug>(fern-aciton-open:vsplit) under specific confitions.

fern-issue-01
fern-issue-02

Environment

  • Editor: Neovim 0.6.1
  • OS: Ubuntu 20.04

Fern setting

vim.g['fern#disable_default_mappings'] = 1
vim.g['fern#disable_drawer_smart_quit'] = 1

function _G.FernInit()
  vim.cmd[[nmap <buffer> <CR> <Plug>(fern-action-open:edit)]]
  vim.cmd[[nmap <buffer> s <Plug>(fern-action-open:vsplit)]]
end

vim.cmd[[augroup FernEvents]]
vim.cmd[[  autocmd!]]
vim.cmd[[  autocmd FileType fern call v:lua.FernInit()]]
vim.cmd[[augroup END]]

Procedure

  1. Boot Neovim
  2. :Fern . -drawer -stay
  3. :q
  4. Open file with <CR> key (<Plug>(fern-action-open:edit))
  5. :Fern . -drawer
  6. Open file with s key (<Plug>(fern-action-open:vsplit))
@lambdalisue lambdalisue added the bug Something isn't working label Apr 6, 2022
@lambdalisue
Copy link
Owner

Reproduced with the procedure and minimal vimrc

if exists('+compatible') && &compatible
  set nocompatible
endif

" Disable Vim's native pack feature
set packpath=

" Clone https://github.com/lambdalisue/fern.vim in somewhere
" and specify that directory to the below
set runtimepath^=~/ghq/github.com/lambdalisue/fern.vim

filetype plugin indent on
syntax on
"----------------------------------------------------------------

nnoremap ; :
nnoremap : ;

let g:fern#disable_default_mappings = 1
let g:fern#disable_drawer_smart_quit = 1

function! s:my_fern() abort
  nmap <buffer> <CR> <Plug>(fern-action-open:edit)
  nmap <buffer> s <Plug>(fern-action-open:vsplit)
endfunction

augroup my_fern
  autocmd!
  autocmd FileType fern call s:my_fern()
augroup END

"----------------------------------------------------------------
echomsg "Custom minimal vimrc has loaded"

@lambdalisue
Copy link
Owner

Could you try #414? @asmka

@asmka
Copy link
Author

asmka commented Apr 6, 2022

@lambdalisue
I confirmed the problem was resolved by #414.
Thank you for your quick handling! 🙇‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants