Skip to content

Make formater remember indentation of commented lines #204

@Ziboo

Description

@Ziboo

Hello,

I often quickly multiline comment functions or part of the code when refactoring.
Unfortunately the formater remove the indentation, so when uncommenting, the function is not valid anymore
In my current workflow, I have to disable the formater for now :(

Would it be possible to add an option to avoid that ?

Note: I do know about """ for commenting but not a huge fan of them, and the formater move them to the end of the file

Thanks you

Steps to reproduce:

  1. Original Function:
func _input(event: InputEvent) -> void:
	if event is InputEventMouseButton:
		if event.pressed:
			if event.button_index == MOUSE_BUTTON_RIGHT:
				print('test')
  1. Adding multiline comments (CTRL+K)
#func _input(event: InputEvent) -> void:
	#if event is InputEventMouseButton:
		#if event.pressed:
			#if event.button_index == MOUSE_BUTTON_RIGHT:
				#print('test')
  1. Formating the file
#func _input(event: InputEvent) -> void:
#if event is InputEventMouseButton:
#if event.pressed:
#if event.button_index == MOUSE_BUTTON_RIGHT:
#print('test')
  1. Uncomenting the lines (CTRL+K)
func _input(event: InputEvent) -> void:
if event is InputEventMouseButton:
if event.pressed:
if event.button_index == MOUSE_BUTTON_RIGHT:
print('test')

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions