kien / ctrlp.vim

Fuzzy file, buffer, mru, tag, etc finder.
kien.github.com/ctrlp.vim
7.26k stars 677 forks source link

^M affixed to end of every entry in files list #781

Closed gfixler closed 4 years ago

gfixler commented 4 years ago

I'm [sadly] on Windows 10 at work, and when I type C-p in Vim in an MSYS2 session, I get these carriage returns on every path. When I select a path, it tries to open a file that includes that ^M on the end, and so I get a new, empty buffer.

Example:

C:/msys64/home/GFixler/code/py/work/gmaya/skin.py^M
C:/msys64/home/GFixler/code/py/work/gmaya/shad.py^M
C:/msys64/home/GFixler/code/py/work/gmaya/poly.py^M
C:/msys64/home/GFixler/code/py/work/gmaya/name.py^M
gfixler commented 4 years ago

Okay, I solved it. I forgot I'd changed how ctrlp gets its listing via this answer. I fixed it by tacking on sed:

let g:ctrlp_user_command = 'ag %s -l --nocolor -g "" | sed "s/\r/\n/"'

Bit hacky, but it works now.