Closed kayfay closed 5 years ago
You should know what is your code.
call dein#call_hook('source')
defines autocmd FileType r
, but it does not call FileType r
autocmd.
You should use lazy load. It calles FileType r
autocmd automatically.
function! AutoOpenREPL() abort
autocmd FileType r if string(g:SendCmdToR) == "function('SendCmdToR_fake')" | call StartR("R") | endif
autocmd VimLeave * if exists("g:SendCmdToR") && string(g:SendCmdToR) != "function('SendCmdToR fake')" | call RQuit("nosave") | endif
endfunction
call dein#source('jalvesaq/Nvim-R', {
\ 'hook_source': function('AutoOpenREPL'),
\ 'on_ft': 'r',
\ })
Im not following...
You should know what is your code.
Should I re-open a ticket and be more clear?
And can you be more clear about what you're talking about. What was the point you were making about using lazy load, did you just copy / paste a block of my code or is that refactored?
function! AutoOpenREPL() abort
autocmd FileType r if string(g:SendCmdToR) == "function('SendCmdToR_fake')" | call StartR("R") | endif
autocmd VimLeave * if exists("g:SendCmdToR") && string(g:SendCmdToR) != "function('SendCmdToR fake')" | call RQuit("nosave") | endif
endfunction
call dein#add('jalvesaq/Nvim-R', {
\ 'hook_source': function('AutoOpenREPL'),
\ 'on_ft': 'r',
\ })
I have mistake the code.
You must use dein#add()
instead. It works for me.
But ... you should read the documentation.
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=/home/atools/.cache/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state('/home/atools/.cache/dein')
call dein#begin('/home/atools/.cache/dein')
" Let dein manage dein
" Required:
call dein#add('/home/atools/.cache/dein/repos/github.com/Shougo/dein.vim')
" Add or remove your plugins here like this:
function! AutoOpenREPL() abort
autocmd FileType r if string(g:SendCmdToR) == "function('SendCmdToR_fake')" | call StartR("R") | endif
autocmd VimLeave * if exists("g:SendCmdToR") && string(g:SendCmdToR) != "function('SendCmdToR fake')" | call RQuit("nosave") | endif
endfunction
call dein#add('jalvesaq/Nvim-R', {
\ 'hook_source': function('AutoOpenREPL'),
\ 'on_ft': 'r',
\ })
" Required:
call dein#end()
call dein#call_hook('source')
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
And can you be more clear about what you're talking about. What was the point you were making about using lazy load, did you just copy / paste a block of my code or is that refactored?
I am very busy to develop plugins.
I understand and this is really great, I appreciate it alot!
Warning: I will close the bug issue without the minimal init.vim and the reproduce ways.
Problems summary
Trying to call the below two at startup and at exit.
---- from docs method as a function seemed to be the only way to implement ----
And AutoOpenREPL or AutoCloseREPL functions do not activate.
Expected
I'm thinking call dein#call_hook('source') will activate call dein#source('....') entries and cause the functions to activate and startup and shutdown of nvim/vim
Environment Information (Required!)
dein.vim version(SHA1): fae99ceaa2e3b514491a5305dc667b1a7618a1d8 (sha1sum ???)
OS: Debian GNU/Linux 9.6 (stretch)
Vim/neovim version: VIM - Vi IMproved 8.0 / nvim v0.4.0-188-g6e6bc3b6c
Provide a minimal .vimrc with less than 50 lines (Required!)
The reproduce ways from Vim starting (Required!)
Screen shot (if possible)
After startup should look like this, it's vim with a REPL...
Upload the log messages by
:redir
and:message
(if errored)n/a