• Milian Wolff's avatar
    Optimize and cleanup the autobrace plugin. · ff4fb760
    Milian Wolff authored
    It needlessly grabbed strings for the full text insertion range,
    while it only operated on single-character insertions.
    This patch bails out early if multi-character insertions are done.
    Especially when opening a large file, this has a big impact, as
    we'd otherwise copy the full file contents temporarily just
    to figure out it's not a brace that was inserted...
    This was found by massif, see e.g. the picture in this blog post:
    The sharp peak at the highest memory consumption is the autobrace
    plugin. With this patch, the peak is gone.
autobrace.cpp 17.7 KB