-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support paragraph breaks in python block comments.
The current python filetype module treats a single empty comment line (typically created by hitting enter twice while in a block comment) as the end of a block comment, deleting the empty comment and ending comment prefix copying. This runs contrary to PEP8, which explicitly allows for paragraphs in block comments, with an empty comment as the paragraph separator. This change implements support for using a single empty comment as a paragraph separator, with two consecutive empty comments being treated as the end of the block comment; both empty comment lines are deleted and comment prefix copying is ended.
- Loading branch information
Showing
33 changed files
with
130 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gjA<ret> |
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# |
2 changes: 2 additions & 0 deletions
2
test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# | ||
# |
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "%val{runtime}/colors/default.kak" | ||
source "%val{runtime}/rc/filetype/python.kak" | ||
set buffer filetype python |
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gjA<ret> |
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# |
2 changes: 2 additions & 0 deletions
2
test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# | ||
# |
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "%val{runtime}/colors/default.kak" | ||
source "%val{runtime}/rc/filetype/python.kak" | ||
set buffer filetype python |
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/exit-block-indented/cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gjA<ret> |
4 changes: 4 additions & 0 deletions
4
test/regression/5147-python-block-comment-paragraphs/exit-block-indented/in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# A new line after a pair of empty comment lines should exit the | ||
# block comment. | ||
# | ||
# |
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/exit-block-indented/out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# A new line after a pair of empty comment lines should exit the | ||
# block comment. | ||
|
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/exit-block-indented/rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "%val{runtime}/colors/default.kak" | ||
source "%val{runtime}/rc/filetype/python.kak" | ||
set buffer filetype python |
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/exit-block/cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gjA<ret> |
4 changes: 4 additions & 0 deletions
4
test/regression/5147-python-block-comment-paragraphs/exit-block/in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# A new line after a pair of empty comment lines should exit the | ||
# block comment. | ||
# | ||
# |
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/exit-block/out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# A new line after a pair of empty comment lines should exit the | ||
# block comment. | ||
|
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/exit-block/rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "%val{runtime}/colors/default.kak" | ||
source "%val{runtime}/rc/filetype/python.kak" | ||
set buffer filetype python |
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gjA<ret> |
4 changes: 4 additions & 0 deletions
4
test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# If we're not in a comment at all, make sure we do the right thing. | ||
# (one empty line and a 4-space prefixed line follows) | ||
|
||
|
5 changes: 5 additions & 0 deletions
5
test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# If we're not in a comment at all, make sure we do the right thing. | ||
# (one empty line and a 4-space prefixed line follows) | ||
|
||
|
||
|
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "%val{runtime}/colors/default.kak" | ||
source "%val{runtime}/rc/filetype/python.kak" | ||
set buffer filetype python |
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/not-a-comment/cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gjA<ret> |
4 changes: 4 additions & 0 deletions
4
test/regression/5147-python-block-comment-paragraphs/not-a-comment/in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# If we're not in a comment at all, make sure we do the right thing. | ||
# (two empty lines follow) | ||
|
||
|
5 changes: 5 additions & 0 deletions
5
test/regression/5147-python-block-comment-paragraphs/not-a-comment/out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# If we're not in a comment at all, make sure we do the right thing. | ||
# (two empty lines follow) | ||
|
||
|
||
|
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/not-a-comment/rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "%val{runtime}/colors/default.kak" | ||
source "%val{runtime}/rc/filetype/python.kak" | ||
set buffer filetype python |
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gjA<ret> |
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# A new line after a single empty comment line should leave the comment in | ||
# place as a possible paragraph separator. | ||
# |
4 changes: 4 additions & 0 deletions
4
test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# A new line after a single empty comment line should leave the comment in | ||
# place as a possible paragraph separator. | ||
# | ||
# |
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "%val{runtime}/colors/default.kak" | ||
source "%val{runtime}/rc/filetype/python.kak" | ||
set buffer filetype python |
1 change: 1 addition & 0 deletions
1
test/regression/5147-python-block-comment-paragraphs/paragraph-break/cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gjA<ret> |
4 changes: 4 additions & 0 deletions
4
test/regression/5147-python-block-comment-paragraphs/paragraph-break/in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# A new line after a single empty comment line should leave the empty comment | ||
# in place as a possible paragraph separator, starting a new comment with the | ||
# prefix copied. | ||
# |
5 changes: 5 additions & 0 deletions
5
test/regression/5147-python-block-comment-paragraphs/paragraph-break/out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# A new line after a single empty comment line should leave the empty comment | ||
# in place as a possible paragraph separator, starting a new comment with the | ||
# prefix copied. | ||
# | ||
# |
3 changes: 3 additions & 0 deletions
3
test/regression/5147-python-block-comment-paragraphs/paragraph-break/rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "%val{runtime}/colors/default.kak" | ||
source "%val{runtime}/rc/filetype/python.kak" | ||
set buffer filetype python |