Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Improve normal command performance

Open s-kai273 opened this issue 4 months ago • 0 comments

What this PR does / why we need it: Currently, when executing :normal commands, TextTransformations (e.g., insertions, replacements) are applied one by one to the editor. This results in multiple sequential updates, which introduces unnecessary overhead and leads to degraded performance, especially for long text insertions or macro executions.

This PR modifies the implementation so that all relevant TextTransformations are aggregated and then applied in bulk. By reducing the number of editor update operations, overall performance is improved while preserving correctness of transformations.

Which issue(s) this PR fixes

Special notes for your reviewer:

  • Please confirm that batched application of TextTransformations preserves the same cursor behavior and side effects as the previous per-step execution.
  • Performance gains should be especially noticeable in scenarios where :normal executes repetitive or large-scale text modifications.

s-kai273 avatar Sep 13 '25 06:09 s-kai273