mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:40:06 +08:00
Improve lang#r layer (#3322)
This commit is contained in:
parent
32cdadba17
commit
d90cf5935c
@ -18,14 +18,15 @@ function! SpaceVim#layers#lang#r#set_variable(var) abort
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#layers#lang#r#config() abort
|
||||
call SpaceVim#plugins#runner#reg_runner('r', 'R --vanilla <%s')
|
||||
call add(g:spacevim_project_rooter_patterns, '.Rprofile')
|
||||
call SpaceVim#plugins#runner#reg_runner('r', 'R <%s')
|
||||
call SpaceVim#mapping#space#regesit_lang_mappings('r', function('s:language_specified_mappings'))
|
||||
if !empty(s:r_repl_command)
|
||||
call SpaceVim#plugins#repl#reg('r',s:r_repl_command)
|
||||
call SpaceVim#plugins#repl#reg('r',s:r_repl_command)
|
||||
else
|
||||
call SpaceVim#plugins#repl#reg('r', 'r')
|
||||
call SpaceVim#plugins#repl#reg('r', 'r')
|
||||
endif
|
||||
|
||||
|
||||
endfunction
|
||||
|
||||
function! s:language_specified_mappings() abort
|
||||
|
@ -168,7 +168,9 @@ function! s:find_root_directory() abort
|
||||
let dir = SpaceVim#util#findFileInParent(pattern, fd)
|
||||
endif
|
||||
let ftype = getftype(dir)
|
||||
if ( ftype ==# 'dir' || ftype ==# 'file' ) && dir !=# expand('~/.SpaceVim.d/')
|
||||
if ( ftype ==# 'dir' || ftype ==# 'file' )
|
||||
\ && dir !=# expand('~/.SpaceVim.d/')
|
||||
\ && dir !=# expand('~/.Rprofile')
|
||||
let dir = s:FILE.unify_path(fnamemodify(dir, ':p'))
|
||||
if ftype ==# 'dir'
|
||||
let dir = fnamemodify(dir, ':h:h')
|
||||
|
Loading…
Reference in New Issue
Block a user