Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“cc” can't automatically indent in .c & .cpp file #3653

Closed
yan42685 opened this issue Apr 5, 2019 · 4 comments
Closed

“cc” can't automatically indent in .c & .cpp file #3653

yan42685 opened this issue Apr 5, 2019 · 4 comments

Comments

@yan42685
Copy link

yan42685 commented Apr 5, 2019

Describe the bug
“cc” can't automatically indent.

To Reproduce
Steps to reproduce the behavior:

  1. Try to use "cc" in normal mode to delete a line and insert some code.
  2. The line is deleted but the cursor is always at the beginning of the line rather than at the indented position.

Expected behavior
After typing "cc" in normal mode, the cursor is expected to be at the indented position.

Screenshots
before :
image
after "cc":
image

Environment (please complete the following information):

  • Extension (VsCodeVim) version: V1.3.0
  • VSCode version: 1.33.0
  • OS: Winows10

Additional context
I have turned on autoindent.
“cc” can indent automatically in .java and .py .json files
only fail to indent in .c/.cpp files

@yan42685 yan42685 changed the title “cc” can “cc” can't automatically indent. Apr 5, 2019
@yan42685 yan42685 changed the title “cc” can't automatically indent. “cc” can't automatically indent in .c & .cpp file Apr 5, 2019
@yam-liu
Copy link

yam-liu commented Jun 28, 2019

+1 for all my files.

@99p
Copy link

99p commented Jul 7, 2019

hi, my c# file too.

@johnathan79717
Copy link

The same in PHP/Hack files for me.

@J-Fields
Copy link
Member

I spent a bit of time understanding how this works today: see #1017 (comment).

TL;DR is that this isn't our problem - language extensions need to define how indentation works in their respective languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants