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

Format just the current statement? #12

Closed
mprobst opened this issue Jun 13, 2016 · 1 comment
Closed

Format just the current statement? #12

mprobst opened this issue Jun 13, 2016 · 1 comment

Comments

@mprobst
Copy link

mprobst commented Jun 13, 2016

If you run clang-format and give either just -cursor, or a empty range at the current cursor, clang-format only formats the current statement, which is quite nice for interactive editing, in particular in a large document where you might not want to modify the rest of the doc (e.g. might not be properly formatted and you want to avoid the edits).

Does VS Code's API support such a use case? Would it make sense to add a keybinding for this?

@xaverh
Copy link
Owner

xaverh commented Nov 5, 2016

This works out of the box now since Visual Studio Code 1.7 provides a "Format selection" command which formats only the selected statement.

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

No branches or pull requests

2 participants