Skip to content

listener_add() callback receives errronious information for 'undo' operations #19947

@cagledw

Description

@cagledw

Steps to reproduce

  1. delete a line with 'dd'
    The listener_add() callback receives:
    {"lnum":1,"col":1,"added":-1,"end":2}

  2. undo with 'u'
    The listener_add() callback receives:
    {"lnum":1,"col":1,"added":-1,"end":2}
    {"lnum":1,"col":1,"added":1,"end":1}

Expected behaviour

The undo operation should NOT report a line deleted (2nd line of original file).
The net number of added & deleted lines should be zero. In this case, the net is 1 deleted line.

Routines tracking changes will erroneous delete the 2nd line of the original file.

Version of Vim

VIM - Vi IMproved 9.2 (2026 Feb 14, compiled Feb 14 2026 12:17:29)

Environment

Operating System: Windows 11

Logs and stack traces

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions