This PR fixes syntax highlighting of C++ floating point and integer literals, which were not properly highlighted as illustrated in the screenshot below:
https://github.com/vim/vim/pull/8939
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
![]()
I should have indicated: I emailed the maintainer of vim/runtime/syntax/cpp.vim (Ken Shan).
Merging #8939 (f343267) into master (d85931e) will decrease coverage by
87.62%.
The diff coverage isn/a.
@@ Coverage Diff @@ ## master #8939 +/- ## =========================================== - Coverage 90.08% 2.45% -87.63% =========================================== Files 151 149 -2 Lines 168894 165905 -2989 =========================================== - Hits 152145 4077 -148068 - Misses 16749 161828 +145079
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-none | ? |
|
| huge-gcc-none | ? |
|
| huge-gcc-testgui | ? |
|
| huge-gcc-unittests | 2.45% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/float.c | 0.00% <0.00%> (-99.22%) |
⬇️ |
| src/gui_gtk_f.c | 0.00% <0.00%> (-97.43%) |
⬇️ |
| src/crypt_zip.c | 0.00% <0.00%> (-97.06%) |
⬇️ |
| src/cmdhist.c | 0.00% <0.00%> (-97.00%) |
⬇️ |
| src/sha256.c | 0.00% <0.00%> (-96.94%) |
⬇️ |
| src/evalbuffer.c | 0.00% <0.00%> (-96.88%) |
⬇️ |
| src/textprop.c | 0.00% <0.00%> (-96.84%) |
⬇️ |
| src/match.c | 0.00% <0.00%> (-96.76%) |
⬇️ |
| src/libvterm/src/rect.h | 0.00% <0.00%> (-96.56%) |
⬇️ |
| src/evalfunc.c | 0.00% <0.00%> (-96.51%) |
⬇️ |
| ... and 137 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered by Codecov. Last update d85931e...f343267. Read the comment docs.
Ken Shan is no longer the maintainer, see https://github.com/vim-jp/vim-cpp
Did this get picked up by vim-jp?
Not yet.
@dpelle Could you create a PR at vim-jp/vim-cpp?
Closed #8939.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Long overdue, but I created PR vim-jp/vim-cpp#63
Closing this one now.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
https://github.com/vim-jp/vim-cpp is now archived, so please reopen this PR?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Reopened #8939.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dpelle or @e-kwsm can you rebase this change and fix the conflicts?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
diff --git a/runtime/syntax/cpp.vim b/runtime/syntax/cpp.vim index 2bf5b1ffc468..b5f4f824d8d2 100644 --- a/runtime/syntax/cpp.vim +++ b/runtime/syntax/cpp.vim @@ -59,8 +59,8 @@ if !exists("cpp_no_cpp14") syn match cppNumber display contained "\<0\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" syn match cppNumber display contained "\<[1-9]\('\=\d\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" syn match cppNumber display contained "\<0\('\=\o\+\)\+\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" - syn match cppNumber display contained "\<0b[01]\('\=[01]\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" - syn match cppNumber display contained "\<0x\x\('\=\x\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppNumber display contained "\<0[bB][01]\('\=[01]\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppNumber display contained "\<0[xX]\x\('\=\x\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" syn match cppFloat display contained "\<\d\('\=\d\+\)*\.\(\d\('\=\d\+\)*\)\=\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" syn match cppFloat display contained "\.\d\('\=\d\+\)*\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" syn match cppFloat display contained "\<\d\+e[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" @@ -71,8 +71,8 @@ endif if !exists("cpp_no_cpp17") syn match cppCast "\<reinterpret_pointer_cast\s*<"me=e-1 syn match cppCast "\<reinterpret_pointer_cast\s*$" - syn match cppFloat display contained "\<0x\x*\.\x\+p[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" - syn match cppFloat display contained "\<0x\x\+\.\=p[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppFloat display contained "\<0[Xx]\x*\.\x\+p[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" + syn match cppFloat display contained "\<0[Xx]\x\+\.\=p[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>" " TODO: push this up to c.vim if/when supported in C23 syn match cppCharacter "u8'[^\\]'" @@ -94,8 +94,8 @@ if !exists("cpp_no_cpp20") syn match cppNumber display contained "\<0\(y\|d\)\>" syn match cppNumber display contained "\<[1-9]\('\=\d\+\)*\(y\|d\)\>" syn match cppNumber display contained "\<0\o\+\(y\|d\)\>" - syn match cppNumber display contained "\<0b[01]\('\=[01]\+\)*\(y\|d\)\>" - syn match cppNumber display contained "\<0x\x\('\=\x\+\)*\(y\|d\)\>" + syn match cppNumber display contained "\<0[Bb][01]\('\=[01]\+\)*\(y\|d\)\>" + syn match cppNumber display contained "\<0[Xx]\x\('\=\x\+\)*\(y\|d\)\>" syn keyword cppStatement co_await co_return co_yield requires syn keyword cppStorageClass consteval constinit syn keyword cppStructure concept
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
That patch seems simple enough to be applied (even so you seem to have missed the capital exponent :) ). Let me include with a syntax test.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thanks.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()