fmt: trim space in embedded comments (#7521)
							parent
							
								
									9d1365ec67
								
							
						
					
					
						commit
						fec9f1324c
					
				| 
						 | 
				
			
			@ -1228,7 +1228,7 @@ pub fn (mut f Fmt) comment(node ast.Comment, options CommentsOptions) {
 | 
			
		|||
			f.writeln(x)
 | 
			
		||||
			f.write('*/')
 | 
			
		||||
		} else {
 | 
			
		||||
			f.write('/* $x */')
 | 
			
		||||
			f.write('/* ${x.trim(' ')} */')
 | 
			
		||||
		}
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,6 +18,10 @@ fn main() {
 | 
			
		|||
	d := c // and an extra one
 | 
			
		||||
	e := c
 | 
			
		||||
	// more comments = more good
 | 
			
		||||
	arr := [
 | 
			
		||||
		/* block foo bar */ /* inline foo bar */
 | 
			
		||||
		0,
 | 
			
		||||
	]
 | 
			
		||||
	// before arg comment
 | 
			
		||||
	// after arg comment
 | 
			
		||||
	println('this is a test')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,6 +12,11 @@ fn main() {
 | 
			
		|||
	d := c // and an extra one
 | 
			
		||||
	e := c
 | 
			
		||||
	// more comments = more good
 | 
			
		||||
	arr := [
 | 
			
		||||
		/*   block foo bar  */
 | 
			
		||||
		//   inline foo bar
 | 
			
		||||
		0,
 | 
			
		||||
	]
 | 
			
		||||
	println(/* before arg comment */ 'this is a test' /* after arg comment */)
 | 
			
		||||
	if /* before if expr */ true /* after if expr */  {
 | 
			
		||||
		println('if')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue