julienr / pycharm-cellmode

PyCharm cell mode
Other
26 stars 6 forks source link

Allow omission of first and last delimiter #1

Closed blyoa closed 8 years ago

blyoa commented 8 years ago

If we want to split a source file into n cells, we need to put just n - 1 delimiters. However, pycharm-cellmode required n + 1 delimiters to surround each cell.

This commit allows omission of first and last delimiter ('##'), so we don't need to put additional delimiters.

before this commit

##
print 'first cell'
##
print 'second cell'
##
print 'third cell (last cell)'
##

after this commit

print 'first cell'
##
print 'second cell'
##
print 'third cell (last cell)'

This commit maintains also backward compatibility, so we don't need to change previously developed python project.

julienr commented 8 years ago

This makes a lot of sense, thanks !

blyoa commented 8 years ago

Thanks!