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

feat(api): Auto-indent provider callback #208

Merged
merged 5 commits into from
Jun 13, 2020

Conversation

bryphe
Copy link
Member

@bryphe bryphe commented Jun 13, 2020

This adds a hook for a custom C indent provider - given the current line, the previous line, and the buffer - the indent provider returns 1 if indentation should be increased, -1 if indentation should be decreased, or 0 if it should remain the same.

This will allow us to set up Onivim 2 to hook into the indentation provider, given the indentation rules provided by VSCode extension language configuration, ie:

  "indentationRules": {
    "increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$",
    "decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$"
  }

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

Successfully merging this pull request may close these issues.

1 participant