Skip to content

Live snippets break undo chains #404

@MichalHacks

Description

@MichalHacks

Bug Report

Disable all the other extensions except for LaTeX Workshop and LaTeX Utilities, and check that you still see this issue.

You still see this issue?: Yes

Describe the bug

After a live snippet is activated and the text changed, the snippet activation cannot be practically undone as immediately after undoing, the snippet activates again.

This breaks the undo chain, as further undo actions just revert and reactivate the snippet, not allowing the user to reach earlier undo states.

To Reproduce

Steps to reproduce the behaviour:

Example 1:

[in math mode]

1. type vmat
2. ctrl + z (whole thing disappears)
3. ctrl + z (vmat snippet activates)

consecutive undo actions repeat step 2 and 3

Example 2:

[in math mode]

1. type sq
2. ctrl + z (whole thing disappears)
3. ctrl + z (sq snippet activates)

consecutive undo actions repeat step 2 and 3

Expected behaviour

After undoing a snippet activation, the program allows for undoing further into the undo chain.

Example:

Visible text:      sq    ->        \sqrt{}       ->    sq    -> [previously typed text]
User action:   Type "sq" -> [snippet activation] -> Ctrl + Z ->        Ctrl + Z

Logs

Please paste the whole log messages here, not parts of ones. It is very important to identify problems. If you think the logs are unrelated, please say so.

Unrelated

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop

  • OS: Windows 10
  • VS Code version: 1.39.1
  • Extension version: v0.4.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions