Skip to content

problems with big strings that contain numbers #69

@itmm

Description

@itmm

Hi,

I had the problem, that vim is not highlighting correctly and stops working when I use string literals in my C++ program that contain big numbers. Here is an example program:

#include <stdio.h>

int main() {
	puts("123456789012345678912345678912345678912345678912345678900000");
}

It is important to save it as a C++ file (e.g. as too_big.cpp) and not as a C file (too_big.c). The C syntax highlighter has no problems with this file, but the C++ syntax highlighter slows down vim, so that it will reduce the syntax highlighting and may stop to react completely.

My configuration is: Macbook Air Apple M1, 16 GB; vim 9.1.1752; vim-cpp from May 2024 04.

Please change the syntax so that big numbers in string literals don't bother the highlighter. These occur regularly as test cases for text processing tools (e.g. md5). As a workaround you can split the string literal into multiple literals ("0-9" "0-9" ...). That will stop the syntax highlighting from getting angry :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions