chr4 / nginx.vim

Improved nginx vim plugin (incl. syntax highlighting)
449 stars 41 forks source link

Fix indenting #20

Closed flosacca closed 1 year ago

flosacca commented 2 years ago

To fix #3, I rewrote the indent script, which replaces cindent with indentexpr. Hope it helps.

chr4 commented 2 years ago

Hey, thanks for your contribution! This looks like a cool idea, however, I'd need some time to review - so please bear with me for a while.

As this plugin was recently integrated into Vim upstream; not sure if it makes sense to open up something there, but they are very active and far more experienced with Vim plugins than I am - so it might be worth a shot?

flosacca commented 2 years ago

OK. I've also opened a PR in Vim upstream.

brammool commented 2 years ago

I prefer the maintainer to send updates to me. That avoids having differences and not knowing whether they are intentional or not.

flosacca commented 2 years ago

Sounds reasonable. I've closed the PR in Vim upstream.

HLFH commented 1 year ago

@chr4 This PR definitely fixes the issues with nginx indentation: https://github.com/chr4/nginx.vim/issues/3. setlocal smartindent in indent/nginx.vim as suggested by you fixes it partially but messes other indentation up, so this PR is the best solution so far and it works like a charm.

Could you merge it? Thanks!

chr4 commented 1 year ago

Sorry everyone, I totally forgot about reviewing this.

It definitly works. The custom function adds some overhead, but I think it's worth it.

chr4 commented 1 year ago

Re-created PR on vim upstream

chr4 commented 1 year ago

There were a few suggestions in the upstream merge request.

any thoughts?

flosacca commented 1 year ago

In indent files bundled with Vim 8.2, both :function and :function! are widely used, so I don't think it matters which one you use. If one is preferred, feel free to modify the code.

I also have little interest in the new syntax of Vim 9, for compatibility reasons.