xavierd / clang_complete

Vim plugin that use clang for completing C/C++ code.
http://www.vim.org/scripts/script.php?script_id=3302
1.96k stars 308 forks source link

Use json.dumps to stringify quickfix content, fixes #270 #524

Closed mlen closed 7 years ago

mlen commented 7 years ago

When a string is not terminated, vim would throw an exception when updating quickfix. This is because str would stringify using single quotes, which in vim are interpreted literally (vim will not interpret the escape sequences and will prematurely terminate a string). Using json.dumps forces the use of double quoted strings, so vim can interpret them correctly

mlen commented 7 years ago

@xaizek could you please take a look and merge if everything is fine? I'm using this patch locally and haven't experienced any issues so far.

xaizek commented 7 years ago

I wasn't sure whether json serialization is a good idea since it's not guaranteed to match Vim syntax, but on the second thought it shouldn't be worse than str(). Thanks.