Sublime Forum

Indent/unindent line comment starting with #

#1

Hello.

Some python code, for example:

def method(arg):
#	bar = 'baz'
	return arg

Staying at the line # bar = 'baz' and trying to indent the line (using indent command):

def method(arg):
	#	bar = 'baz'
	return arg

Can I reseive this:

def method(arg):
#		bar = 'baz'
	return arg

?

Let’s looks at indented comment:

def method(arg):
#		bar = 'baz'
	return arg

Staying at the commented line and trying to unindent (using unindent command).
Nothing happens, because of no spaces at begin of the line.
Can I receive this:

def method(arg):
#	bar = 'baz'
	return arg

?

So, can indent/unindent command consider spaces and tabs inside the comment and change it, instead of add or delete spaces at begin of the string before #?
Or only custom plugin can do this by modification of the text block after indenting?

0 Likes