Skip to content

feat: add range formatting to formatter #1533

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

Closed
wants to merge 1 commit into from

Conversation

guru245
Copy link
Contributor

@guru245 guru245 commented May 13, 2025

Range formatting in Conform is a standout feature that many other formatters lack. However, it was previously missing from kickstart. I’ve now added it, based on the guidance from this section of the conform.nvim documentation.

This change is fully backward-compatible. Existing users can continue to use <leader>k to format the entire file as before. If they select a block of code and press <leader>k, only the selected range will be formatted.

@szechp
Copy link
Contributor

szechp commented May 23, 2025

I've been using this for the last couple of days, and I'm running in all sort of issues when I use this on visual selection:

  1. it obviously doesn't have the context of the whole file, so indentation on Lua files is all sorts of broken.
  2. Weird behavior where variables or names of functions get converted to lowercase.

I reverted it back to the original behavior.

@guru245
Copy link
Contributor Author

guru245 commented May 23, 2025

@szechp Thank you for the feedback and testing.

As a C programmer, I only tested it in C/C++, which was working. But as you said, I also found it's not working in lua. I will close this PR and report the issue to the conform owner. When it's resolved, I will get back and reopen this.

Sorry for the trouble I've caused.

@guru245 guru245 closed this May 23, 2025
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.

2 participants