Comments (4)
确实是bug,因为路径是GBK编码的而缓冲区则用utf-8打开,所以导致了乱码。
感谢提交issue!
from ctrlsf.vim.
感觉这个问题有点困难。粗略看了一下 nerdtree 里的路径是通过getcwd()
之类的函数由 vim 传进来的,所以已经转换成了 utf-8 编码。而 ctrlsf 的路径和文件名则是外部程序的ack
或者ag
的输出结果,没有经过编码转换。目前能够想到的办法就只有想办法自己解码或者设定缓冲区编码。(但还有一个问题,如果文件内容和路径是不同编码的话,就很难办了)
from ctrlsf.vim.
外部程序的输出结果,其编码一般和locale一致,如果vim的encoding和locale一致,就不会出现乱码。如果能获得locale的编码,再转换成&encoding对应的编码,乱码问题就会解决。通过vim脚本貌似很难实现,不过可以使用python来解决编码问题。
from ctrlsf.vim.
诚如你所说,这个问题解决起来比较困难。(而且因为我不是windows系统,测试也比较麻烦)目前插件还存在着很多其他影响面更广的问题(特别是高亮不正确,以及部分 escape有问题),所以我想先把这个issue放一下。如果你找到了好的解决办法的话,还请提出pull-request,thx!
ps: 我觉得可能可以从改变源头出发。目前 ctrlsf 的机制是把 ag 的输出结果改变一下样式以后直接显示出来,所以受制于 ag 的编码处理。可以换成对 ag 的结果只是解析,在解析得到所有匹配的位置以后,自己通过读取这些位置的文件内容来组织显示的结果,这样应该就可以解决编码问题了。
from ctrlsf.vim.
Related Issues (20)
- preview window positioning HOT 6
- Error in ctrlsf#fs#FindProjectRoot HOT 4
- Keymap to open file in a vertical split HOT 2
- Question: Can I map or default the compact style to use quickfix list? HOT 1
- 查找时提示winlayout未定义 HOT 5
- How to specify search path? HOT 3
- *.hpp can't be find as default HOT 2
- search word with -W, the matched lines in result is not right HOT 1
- Which regex engine? HOT 1
- "free(): invalid pointer" when doing async searches with neovim HOT 2
- Make filename not editable HOT 2
- async chops off first character when editing many files HOT 1
- preview with mouse
- Is it possible to search sentences rather than just a single word? HOT 2
- ctrlsf_backend keeps miserror HOT 3
- Question: is it possible to customize search for a word?
- How can I replace all occurence of the searched keyword? HOT 3
- Sync CtrlSF compact window when navigating via quickfix HOT 4
- Error detected while processing - Invalid argument HOT 1
- Feature request/query: how to pass a list of files to grep through? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctrlsf.vim.