Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Undo sequence breaking #3146

@sbond75

Description

@sbond75

Describe the bug
Certain autocompletions break the undo sequence, causing u to undo more or less times than it should.

  1. When pressing ctrl + space to autocomplete and the entire sole autocompletion is already present (there is only one viable candidate for the completion and the entire completion is typed out already), that one is chosen, and then the undo sequence is broken.
  2. Parenthesis autocompletions break the undo sequence.

(Terminology note: from what I have observed, "breaking the undo sequence" means that from then on, undoing will act strangely, causing more or less to be undone when pressing u.)

To Reproduce
Steps to reproduce the behavior:

  1. In a C++ Visual Studio project, create or open a source file in the project (with IntelliSense active).
  2. Type/paste this text in:
#include <stdio.h>

void f() {
    
}
  1. In the body of f, type printf_s. Then press ctrl + space, and it will autocomplete using only one available completion: printf_s. This should break the undo sequence (as seen when pressing the dropdown arrow next to the undo button afterwards).
  2. Undo and re-add the code above (so f has an empty body).
  3. In the body of f, type printf(. Visual Studio should fill in the remaining ), also causing a break in the undo sequence.

Expected behavior
I expect that these actions won't break the undo sequence, or that pressing u will undo the edits performed in the last insert mode for example, not more or less.

Environment (please complete the following information):

  • Visual Studio version: 17.4.4
  • VsVim version: 2.10.0.6
  • Programming Language: C++
  • Check(Type 'x') any that are installed:
    • ReSharper
    • Visual Assist

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