Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgExpl.py line 955 #948

Closed
qiushihao opened this issue Aug 23, 2022 · 5 comments · Fixed by #950
Closed

rgExpl.py line 955 #948

qiushihao opened this issue Aug 23, 2022 · 5 comments · Fixed by #950

Comments

@qiushihao
Copy link
Contributor

在用rg -e全局搜索后,用Q将结果导入quickfix的时候,如果结果里有一些特殊字符, json.dumps(items) 这里就会crash报错.

我在里面加了个参数 json.dumps(items, ensure_ascii=False) 来解决问题。

希望能在复现后修复这个问题。

一个比较简单的复现方法是去搜索vim的runtime/tutor下面的小语种的比如tutor.sv里的单词,哪怕搜的只是普通单词,只要搜索结果里同一行有那种不在字符集里面的特殊字符,导入quickfix时候就会报错。

@Yggdroot
Copy link
Owner

复现不了。

@qiushihao
Copy link
Contributor Author

嗯嗯,可能是我描述的不够清楚,我把过程复现一下:
首先在vim安装目录里打开tutor.sv

IMG_3046(20220829-114725)

然后搜索“radera” 这个单词,加不加其他参数都行,不影响复现
IMG_3047(20220829-114733)

然后可以看到下面的结果里,在“radera” 同一行里,有一些无法显示的字符
IMG_3048

然后用Q把结果导入quickfix,就会报错了
IMG_3049(20220829-114752)

@Yggdroot
Copy link
Owner

奇怪,我搜出来的是runtime/tutor/tutor.sv:267: 2. Fr att radera frn markren, 那些非ASCII字符直接消失,所以没报错,不知道是不是rg版本的问题。
我的是

rg --version
ripgrep 12.1.1
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)

@Yggdroot
Copy link
Owner

不是rg的问题,在命令行下用没问题。不知道为什么我的vim中,那些非ascii字符为什么被过滤掉了。

@Yggdroot
Copy link
Owner

如果 json.dumps(items, ensure_ascii=False)可以解决问题,帮忙提个PR,谢谢。

This was referenced Sep 1, 2022
Yggdroot pushed a commit that referenced this issue Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants