voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.5k stars 81 forks source link

Opener not working #279

Closed aca closed 3 years ago

aca commented 3 years ago

Before reporting

Environment

If you are using vim(not neovim), fill in the following blanks

NVIM v0.5.0-dev+1211-g6db3ba9df
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/rok/.cache/yay/neovim-git/src/build/config -I/home/rok/.cache/yay/neovim-git/src/neovim-git/src -I/usr/include -I/home/rok/.cache/yay/neovim-git/src/build/src/nvim/auto -I/home/rok/.cache/yay/neovim-git/src/build/include
Compiled by rok@rok-te3

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

If you are using neovim, just run :checkhealth floaterm and post the content

below.

  health#floaterm#check
  ========================================================================
  ## common
    - INFO: Platform: linux
    - INFO: Nvim: NVIM v0.5.0-dev+1211-g6db3ba9df
    - INFO: Plugin: ae7eea5

  ## terminal
    - OK: Terminal emulator is available

  ## floating
    - OK: Floating window is available

Configurations related to vim-floaterm in vimrc(i.e. g:floaterm_xxx):

NONE

Describe your question, feature request, or bug.

Steps to reproduce

Using the minimal vimrc

set nocompatible
set hidden
set termguicolors
set runtimepath^=/path/to/vim-floaterm
filetype plugin indent on
syntax on

Steps to reproduce the behavior:

Actual behaviour

Cannot open file with nnn/vifm. Since 6b5da6a It seems like opener is passed to the function.

Error detected while processing function <SNR>61_on_floaterm_close[27]..<SNR>60_vifm_callback[12]..floaterm#util#open:
line    2:
E385: search hit BOTTOM without match for: home
Press ENTER or type command to continue
Error detected while processing function <SNR>61_on_floaterm_close[27]..<SNR>60_nnn_callback[12]..floaterm#util#open:
line    2:
E385: search hit BOTTOM without match for: home
voldikss commented 3 years ago

What's your command?

aca commented 3 years ago

@voldikss Just command in examples.

command! Vifm FloatermNew vifm
voldikss commented 3 years ago

I've tried your config in https://github.com/aca/dotfiles/blob/master/.config/nvim/init.vim#L973-L985 but still can not reproduce the issue. I feel that It might be caused by vifm settings.

aca commented 3 years ago

@voldikss Oh.. I think I found the problem. It's problem with my vimrc. I'm really sorry. Thank you very much.

It seems like buffer variable(b:floaterm_opener) is not set. So it failed to find valid opener. Don't know why this is an issue. But nevermind I just removed it.

  " Ignore various filetypes as those will close terminal automatically
  " Ignore fzf, ranger, coc
  " autocmd TermClose term://*
  "       \ if (expand('<afile>') !~ "fzf") && (expand('<afile>') !~ "ranger") && (expand('<afile>') !~ "coc") |
  "       \   call nvim_input('<CR>')  |
  "       \ endif