clojure-vim / acid.nvim

Asynchronous Clojure Interactive Development
161 stars 12 forks source link

Unknown function: trim #64

Closed elzibubble closed 4 years ago

elzibubble commented 5 years ago

I get this when calling AcidRequire:

E5105: Error while calling lua chunk: /home/alee/.vim/bundle/acid.nvim//lua/acid/connections.lua:91: Vim:E117: Unknown function: trim

I just installed Acid today, quite possible I've done something wrong. I'm using Plug.vim (also just switched from Vundle...). I still have Fireplace installed.

Lua 5.1                                                                                                                                                                                                                                                                                                                                                                                                                                     
:version                                                                                                                                                                                                                                                                                                                                                                                                                                    
NVIM v0.3.1-1-g489d32f2b                                                                                                                                                                                                                                                                                                                                                                                                                    
Build type: RelWithDebInfo                                                                                                                                                                                                                                                                                                                                                                                                                  
LuaJIT 2.0.5                                                                                                                                                                                                                                                                                                                                                                                                                                
Compilation: /usr/bin/gcc-5 -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include                                                                                                                                                                           
Compiled by travis@travis-job-ecc960f4-8e53-44e6-a8e8-9587ed80f885                                                                                                                                                                                                                                                                                                                                                                          
call plug#begin('~/.vim/bundle')
Plug 'AndrewRadev/splitjoin.vim'
Plug 'FelikZ/ctrlp-py-matcher'
Plug 'PeterRincker/vim-argumentative'
Plug 'Shougo/neocomplete'
Plug 'avakhov/vim-yaml'
Plug 'bps/vim-textobj-python'
Plug 'chrisbra/NrrwRgn'
Plug 'chrisbra/SudoEdit.vim'
Plug 'christianrondeau/vim-base64'
" Plug 'christoomey/vim-tmux-navigator'
Plug 'clojure-vim/acid.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'elzr/vim-json'
Plug 'eraserhd/parinfer-rust', {'do': 'cargo build --release'}
Plug 'ervandew/supertab'
" Plug 'gastonsimone/vim-dokumentary'
Plug 'godlygeek/tabular'
Plug 'guns/vim-sexp'
Plug 'jceb/vim-textobj-uri'
Plug 'jreybert/vimagit'
" Plug 'junegunn/fzf', {'do': './install --all'}
Plug 'kana/vim-textobj-indent'
Plug 'kana/vim-textobj-user'
Plug 'kien/ctrlp.vim'
Plug 'kien/rainbow_parentheses.vim'
Plug 'mattboehm/vim-accordion'
Plug 'michaeljsmith/vim-indent-object'
Plug 'nanotech/jellybeans.vim'
Plug 'ntpeters/vim-better-whitespace'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/syntastic'
Plug 'sgur/vim-textobj-parameter'
Plug 'sjl/gundo.vim'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-classpath'
Plug 'tpope/vim-commentary'
" Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-fireplace'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-projectionist'
Plug 'tpope/vim-repeat'
" Plug 'tpope/vim-sexp-mappings-for-regular-people'
Plug 'tpope/vim-speeddating'
Plug 'tpope/vim-surround'
" Plug 'typedclojure/vim-typedclojure'
Plug 'venantius/vim-cljfmt'
Plug 'xenomachina/public', {'rtp': 'vim/'}
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
Plug 'lxsli/vim-unimpaired'
" Plug 'lxsli/vim-unstack'
Plug 'lxsli/ftplugins'
call plug#end()
hkupty commented 5 years ago

Hi! Thank you very much for the issue.

That is possibly a bug, to be honest. trim is a function that should exist on lua but if it isn't provided, it falls back to a viml implementation. I suspect the viml counterpart might be wrongly named.

I'll check that today, but if you feel comfortable, it's just (probably) changing the viml fn being called on lua/acid/utils.lua.

Once again,thanks for the issue. I'll look into it.

Best, Henry

elzibubble commented 5 years ago

Thanks for the swift response! Any idea why I wouldn't have that in lua? I guess it's to do with my NeoVim version. On updating to 0.3.5 (latest stable), I now get this:

error caught in async handler '/home/alee/.vim/bundle/acid.nvim/rplugin/python3/acid:function:AcidSendNrepl [[{'code': "(require '[curiosity.handler :reload :all])", 'id': '01DBCMPT4R4Y0E0YMRCNR64J3Y', 'op': 'eval'}]]'                                                                                                                                                                                                        
Traceback (most recent call last):
  File "/home/alee/.vim/bundle/acid.nvim/rplugin/python3/acid/__init__.py", line 47, in acid_eval
    payload, addr = data
ValueError: not enough values to unpack (expected 2, got 1)

Aha, starting a REPL has sorted that out.

hkupty commented 5 years ago

Glad to know things are sorted out!

I should block acid from sending to the nrepl if there's no connection present.

hkupty commented 4 years ago

I believe this is fixed now. I'll close the issue, but feel free to reopen if it still happens. Best regards, Henry