nixprime / cpsm

A CtrlP matcher, specialized for paths.
Apache License 2.0
202 stars 19 forks source link

Returns 0, no matter the search #21

Closed tankorsmash closed 8 years ago

tankorsmash commented 8 years ago

I'm running Ubuntu 16.04beta, so the libs I used to compile are fairly experimental. No matter what I search for with ctrlp, and cpsm set as the matcher, the result is always 0.

The only ctrlp setting I have enabled is the setting the match_func, and if I remove it, ctrlp works as normal.

If it's relevant, here's the output of install.sh

$ sudo ./install.sh
-- The C compiler identification is GNU 5.3.1
-- The CXX compiler identification is GNU 5.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   program_options
-- Found ICU header files in /usr/include/x86_64-linux-gnu
-- Found ICU libraries: /usr/lib/x86_64-linux-gnu/libicuuc.so
-- Found PythonInterp: /usr/bin/python2.7 (found version "2.7.11") 
-- Found Python executable: /usr/bin/python2.7
-- Found Python version: 2.7.11+
-- Found Python library: /usr/lib/x86_64-linux-gnu/libpython2.7.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
WARNING: Target "cpsm_cli" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it.  CMake does not define behavior for this case.
WARNING: Target "matcher_test" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it.  CMake does not define behavior for this case.
-- Generating done
-- Build files have been written to: /home/username/.vim/bundle/cpsm/build
Scanning dependencies of target cpsm_core
[ 20%] Building CXX object CMakeFiles/cpsm_core.dir/src/str_util.cc.o
[ 40%] Linking CXX static library libcpsm_core.a
[ 40%] Built target cpsm_core
Scanning dependencies of target cpsm_py
[ 60%] Building CXX object CMakeFiles/cpsm_py.dir/src/ctrlp_util.cc.o
[ 80%] Building CXX object CMakeFiles/cpsm_py.dir/src/python_extension_main.cc.o
[100%] Linking CXX shared library cpsm_py.so
[100%] Built target cpsm_py
Install the project...
-- Install configuration: "Release"
-- Installing: /home/username/.vim/bundle/cpsm/autoload/cpsm_py.so
-- Installing: /home/username/.vim/bundle/cpsm/test/cpsm_py.so
nixprime commented 8 years ago

Can you run vim -V9vimlog in any directory, invoke Ctrl-P (getting a result of 0), then :qa and look for a Vim or Python error near the bottom of the vimlog file?

tankorsmash commented 8 years ago

Seems like s:regexes isn't defined, but I'm not quite sure. Oh, my vim is only compiled with -python +python3, this is probably a requirement for +python. I'll see if I can get cpsm going for python3 maybe.

Since Ubuntu 16 doesn't ship with Python2.7 by default anymore, it seems like its going to be harder and harder to get a version of vim compiled with Python2.7 support.

Thanks for the verbose vim log tip.

fchdir() to previous dir
line 14: sourcing "/home/username/.vim/bundle/cpsm/autoload/cpsm.vim"
Error detected while processing /home/username/.vim/bundle/cpsm/autoload/cpsm.vim:
line   41:
E319: Sorry, the command is not available in this version: pyfile /home/username/.vim/bundle/cpsm/autoload/cpsm.py
finished sourcing /home/username/.vim/bundle/cpsm/autoload/cpsm.vim
continuing in function ctrlp#init[17]..<SNR>64_BuildPrompt[6]..<SNR>64_Update[11]..<SNR>64_MatchedItems
Error detected while processing function ctrlp#init[17]..<SNR>64_BuildPrompt[6]..<SNR>64_Update[11]..<SNR>64_MatchedItems[14]..cpsm#CtrlPMatch:
line    6:
E319: Sorry, the command is not available in this version:     py ctrlp_match()
Error detected while processing function ctrlp#init[17]..<SNR>64_BuildPrompt[6]..<SNR>64_Update[11]..<SNR>64_MatchedItems[14]..cpsm#CtrlPMatch:
line   10:
E121: Undefined variable: s:regexes
Error detected while processing function ctrlp#init[17]..<SNR>64_BuildPrompt[6]..<SNR>64_Update[11]..<SNR>64_MatchedItems[14]..cpsm#CtrlPMatch:
line   10:
E15: Invalid expression: s:regexes
Error detected while processing function ctrlp#init[17]..<SNR>64_BuildPrompt[6]..<SNR>64_Update[11]..<SNR>64_MatchedItems[14]..cpsm#CtrlPMatch:
line   15:
E121: Undefined variable: s:results
Error detected while processing function ctrlp#init[17]..<SNR>64_BuildPrompt[6]..<SNR>64_Update[11]..<SNR>64_MatchedItems[14]..cpsm#CtrlPMatch:
line   15:
E15: Invalid expression: s:results
Error detected while processing function ctrlp#init[17]..<SNR>64_BuildPrompt[6]..<SNR>64_Update[14]..<SNR>64_Render:
line   11:
E706: Variable type mismatch for: lines>>> _
Executing CursorMoved Auto commands for "*"
autocommand call s:Highlight_Matching_Pair()
nixprime commented 8 years ago

E319: Sorry, the command is not available in this version: pyfile /home/username/.vim/bundle/cpsm/autoload/cpsm.py

Aha, it seems your Vim binary was built without Python support. I wonder if this is due to a switch to Python 3. Can you try :echo has('python') and :echo has('python3') in Vim? I've pushed a small change that should at least detect this condition.

As for Python 3 support... I haven't tried it, so I don't know what won't work (at a minimum, I'm not sure what string types Vim will use). And CMake apparently doesn't play very well with it. So it might be a while.

tankorsmash commented 8 years ago

No worries, that was it then! Thanks for your help, I'll close this off.

My understanding of Python3 in terms of backwards compat stuff is you can just replace the strings with the byte prefix, so that they're treated like Python2s string instead of unicode.

If you're looking to get vim with python2 support instead of python3, you'll need vim-python. I use gVim, so the command was sudo apt-get install vim-gnome-py2.

Thanks again!