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

fmt: fix formating non-unsafe blocks with break line (fix #22900) #22903

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Nov 18, 2024

This PR fix formating non-unsafe blocks with break line (fix #22900).

  • Fix formating non-unsafe blocks with break line.
  • Add test.

blocks_keep.vv

fn main() {
	{
		println('(1/3) My first small scope')
		//
	}

	{
		println('(2/3) My second small scope')
		//
	}
	// A line below prevents the line removal

	{
		println('(3/3) My Third small scope')
	}
}

Huly®: V_0.6-21346

vlib/v/fmt/fmt.v Outdated Show resolved Hide resolved
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 7a4b3ab into vlang:master Nov 18, 2024
68 checks passed
@yuyi98 yuyi98 deleted the fix_fmt_blocks branch November 19, 2024 00:59
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.

Formatter removes lines (1 per formatting) after scope block in function body
2 participants