Skip to content

feat: respect cindent and smartindent#6

Open
sharpchen wants to merge 1 commit intowurli:mainfrom
sharpchen:cindent
Open

feat: respect cindent and smartindent#6
sharpchen wants to merge 1 commit intowurli:mainfrom
sharpchen:cindent

Conversation

@sharpchen
Copy link

Vim/Neovim has three strategies of indentation, smartindent, cindent, indentexpr, see :h C-indenting. Current implementation does not respect the other two options when indentexpr is empty. So this pr added support for cindent and smartindent, and with some other changes for better adaption of indentexpr.

  • use vim.api.nvim_eval for safe_eval so that it can evaluate indentexpr with parameter within expr such as GetCSIndent(v:lnum)
  • lang is not always filetype, fixed with a non-exhaustive manual switch

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