summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-06-11 19:39:07 +1000
committerMaxime Coste <mawww@kakoune.org>2024-06-11 19:39:07 +1000
commit5a6fb51bdb43f15eafdbe1078183f754b4fecdf6 (patch)
treed04d839f914cf95124ec8e586a7f1687b2a3a536
parent17c25cc86a6bf4779f58fe2d2a5c13147bb27f2b (diff)
Tweak python block command test location and remove wall of text
We do not typically go into lengthy explanation of the code in the support scripts. This would have a performance impact (as comments are not trimmed in advance) and feels out of place.
-rw-r--r--rc/filetype/python.kak19
-rw-r--r--test/indent/python/empty-start-of-file-indented/cmd (renamed from test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/cmd)0
-rw-r--r--test/indent/python/empty-start-of-file-indented/in (renamed from test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/in)0
-rw-r--r--test/indent/python/empty-start-of-file-indented/out (renamed from test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/out)0
-rw-r--r--test/indent/python/empty-start-of-file-indented/rc (renamed from test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/rc)0
-rw-r--r--test/indent/python/empty-start-of-file/cmd (renamed from test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/cmd)0
-rw-r--r--test/indent/python/empty-start-of-file/in (renamed from test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/in)0
-rw-r--r--test/indent/python/empty-start-of-file/out (renamed from test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/out)0
-rw-r--r--test/indent/python/empty-start-of-file/rc (renamed from test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/rc)0
-rw-r--r--test/indent/python/exit-block-indented/cmd (renamed from test/regression/5147-python-block-comment-paragraphs/exit-block-indented/cmd)0
-rw-r--r--test/indent/python/exit-block-indented/in (renamed from test/regression/5147-python-block-comment-paragraphs/exit-block-indented/in)0
-rw-r--r--test/indent/python/exit-block-indented/out (renamed from test/regression/5147-python-block-comment-paragraphs/exit-block-indented/out)0
-rw-r--r--test/indent/python/exit-block-indented/rc (renamed from test/regression/5147-python-block-comment-paragraphs/exit-block-indented/rc)0
-rw-r--r--test/indent/python/exit-block/cmd (renamed from test/regression/5147-python-block-comment-paragraphs/exit-block/cmd)0
-rw-r--r--test/indent/python/exit-block/in (renamed from test/regression/5147-python-block-comment-paragraphs/exit-block/in)0
-rw-r--r--test/indent/python/exit-block/out (renamed from test/regression/5147-python-block-comment-paragraphs/exit-block/out)0
-rw-r--r--test/indent/python/exit-block/rc (renamed from test/regression/5147-python-block-comment-paragraphs/exit-block/rc)0
-rw-r--r--test/indent/python/not-a-comment-indented/cmd (renamed from test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/cmd)0
-rw-r--r--test/indent/python/not-a-comment-indented/in (renamed from test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/in)0
-rw-r--r--test/indent/python/not-a-comment-indented/out (renamed from test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/out)0
-rw-r--r--test/indent/python/not-a-comment-indented/rc (renamed from test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/rc)0
-rw-r--r--test/indent/python/not-a-comment/cmd (renamed from test/regression/5147-python-block-comment-paragraphs/not-a-comment/cmd)0
-rw-r--r--test/indent/python/not-a-comment/in (renamed from test/regression/5147-python-block-comment-paragraphs/not-a-comment/in)0
-rw-r--r--test/indent/python/not-a-comment/out (renamed from test/regression/5147-python-block-comment-paragraphs/not-a-comment/out)0
-rw-r--r--test/indent/python/not-a-comment/rc (renamed from test/regression/5147-python-block-comment-paragraphs/not-a-comment/rc)0
-rw-r--r--test/indent/python/paragraph-break-indented/cmd (renamed from test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/cmd)0
-rw-r--r--test/indent/python/paragraph-break-indented/in (renamed from test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/in)0
-rw-r--r--test/indent/python/paragraph-break-indented/out (renamed from test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/out)0
-rw-r--r--test/indent/python/paragraph-break-indented/rc (renamed from test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/rc)0
-rw-r--r--test/indent/python/paragraph-break/cmd (renamed from test/regression/5147-python-block-comment-paragraphs/paragraph-break/cmd)0
-rw-r--r--test/indent/python/paragraph-break/in (renamed from test/regression/5147-python-block-comment-paragraphs/paragraph-break/in)0
-rw-r--r--test/indent/python/paragraph-break/out (renamed from test/regression/5147-python-block-comment-paragraphs/paragraph-break/out)0
-rw-r--r--test/indent/python/paragraph-break/rc (renamed from test/regression/5147-python-block-comment-paragraphs/paragraph-break/rc)0
33 files changed, 1 insertions, 18 deletions
diff --git a/rc/filetype/python.kak b/rc/filetype/python.kak
index 4b1a9c76..5f42a7de 100644
--- a/rc/filetype/python.kak
+++ b/rc/filetype/python.kak
@@ -167,24 +167,7 @@ define-command -hidden python-insert-on-new-line %{ evaluate-commands -itersel -
execute-keys <semicolon>
try %{
evaluate-commands -draft -save-regs '/"' %{
- # Handle block comment continuation/termination.
- #
- # This code applies in the context where we have a new line
- # inserted, and the previous line is a block comment (i.e. a line
- # that matches '^\h*#+\h*\S*$'). We assume that the comment will
- # be continued, so we copy the prefix (all leading whitespace, any
- # '#' characters, and then any additional whitespace before the
- # next non-whitespace character) into the new line.
- #
- # PEP8's text on block comments says they can include an empty
- # comment (i.e. '^\h*#+\h*$') as a paragraph separator - we
- # leave a single empty comment as-is, to allow paragraph breaks,
- # but if we see two consecutive empty comments we exit the
- # comment block and delete the empty comments.
- # Reference: https://peps.python.org/pep-0008/#block-comments
- #
- # first, make sure we're in the right context - don't wrap this
- # in a try/catch so we fail out immediately
+ # Ensure previous line is a comment
execute-keys -draft kxs^\h*#+\h*<ret>
# now handle the coment continuation logic
diff --git a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/cmd b/test/indent/python/empty-start-of-file-indented/cmd
index 60ee9918..60ee9918 100644
--- a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/cmd
+++ b/test/indent/python/empty-start-of-file-indented/cmd
diff --git a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/in b/test/indent/python/empty-start-of-file-indented/in
index 641ef36f..641ef36f 100644
--- a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/in
+++ b/test/indent/python/empty-start-of-file-indented/in
diff --git a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/out b/test/indent/python/empty-start-of-file-indented/out
index fee7ebff..fee7ebff 100644
--- a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/out
+++ b/test/indent/python/empty-start-of-file-indented/out
diff --git a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/rc b/test/indent/python/empty-start-of-file-indented/rc
index a098fc21..a098fc21 100644
--- a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file-indented/rc
+++ b/test/indent/python/empty-start-of-file-indented/rc
diff --git a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/cmd b/test/indent/python/empty-start-of-file/cmd
index 60ee9918..60ee9918 100644
--- a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/cmd
+++ b/test/indent/python/empty-start-of-file/cmd
diff --git a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/in b/test/indent/python/empty-start-of-file/in
index 792d6005..792d6005 100644
--- a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/in
+++ b/test/indent/python/empty-start-of-file/in
diff --git a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/out b/test/indent/python/empty-start-of-file/out
index 0f3b43f3..0f3b43f3 100644
--- a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/out
+++ b/test/indent/python/empty-start-of-file/out
diff --git a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/rc b/test/indent/python/empty-start-of-file/rc
index a098fc21..a098fc21 100644
--- a/test/regression/5147-python-block-comment-paragraphs/empty-start-of-file/rc
+++ b/test/indent/python/empty-start-of-file/rc
diff --git a/test/regression/5147-python-block-comment-paragraphs/exit-block-indented/cmd b/test/indent/python/exit-block-indented/cmd
index 60ee9918..60ee9918 100644
--- a/test/regression/5147-python-block-comment-paragraphs/exit-block-indented/cmd
+++ b/test/indent/python/exit-block-indented/cmd
diff --git a/test/regression/5147-python-block-comment-paragraphs/exit-block-indented/in b/test/indent/python/exit-block-indented/in
index 0092d9ec..0092d9ec 100644
--- a/test/regression/5147-python-block-comment-paragraphs/exit-block-indented/in
+++ b/test/indent/python/exit-block-indented/in
diff --git a/test/regression/5147-python-block-comment-paragraphs/exit-block-indented/out b/test/indent/python/exit-block-indented/out
index 36283e91..36283e91 100644
--- a/test/regression/5147-python-block-comment-paragraphs/exit-block-indented/out
+++ b/test/indent/python/exit-block-indented/out
diff --git a/test/regression/5147-python-block-comment-paragraphs/exit-block-indented/rc b/test/indent/python/exit-block-indented/rc
index a098fc21..a098fc21 100644
--- a/test/regression/5147-python-block-comment-paragraphs/exit-block-indented/rc
+++ b/test/indent/python/exit-block-indented/rc
diff --git a/test/regression/5147-python-block-comment-paragraphs/exit-block/cmd b/test/indent/python/exit-block/cmd
index 60ee9918..60ee9918 100644
--- a/test/regression/5147-python-block-comment-paragraphs/exit-block/cmd
+++ b/test/indent/python/exit-block/cmd
diff --git a/test/regression/5147-python-block-comment-paragraphs/exit-block/in b/test/indent/python/exit-block/in
index 582a11c7..582a11c7 100644
--- a/test/regression/5147-python-block-comment-paragraphs/exit-block/in
+++ b/test/indent/python/exit-block/in
diff --git a/test/regression/5147-python-block-comment-paragraphs/exit-block/out b/test/indent/python/exit-block/out
index 21bc5075..21bc5075 100644
--- a/test/regression/5147-python-block-comment-paragraphs/exit-block/out
+++ b/test/indent/python/exit-block/out
diff --git a/test/regression/5147-python-block-comment-paragraphs/exit-block/rc b/test/indent/python/exit-block/rc
index a098fc21..a098fc21 100644
--- a/test/regression/5147-python-block-comment-paragraphs/exit-block/rc
+++ b/test/indent/python/exit-block/rc
diff --git a/test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/cmd b/test/indent/python/not-a-comment-indented/cmd
index 60ee9918..60ee9918 100644
--- a/test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/cmd
+++ b/test/indent/python/not-a-comment-indented/cmd
diff --git a/test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/in b/test/indent/python/not-a-comment-indented/in
index f3c7955e..f3c7955e 100644
--- a/test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/in
+++ b/test/indent/python/not-a-comment-indented/in
diff --git a/test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/out b/test/indent/python/not-a-comment-indented/out
index 9748afb0..9748afb0 100644
--- a/test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/out
+++ b/test/indent/python/not-a-comment-indented/out
diff --git a/test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/rc b/test/indent/python/not-a-comment-indented/rc
index a098fc21..a098fc21 100644
--- a/test/regression/5147-python-block-comment-paragraphs/not-a-comment-indented/rc
+++ b/test/indent/python/not-a-comment-indented/rc
diff --git a/test/regression/5147-python-block-comment-paragraphs/not-a-comment/cmd b/test/indent/python/not-a-comment/cmd
index 60ee9918..60ee9918 100644
--- a/test/regression/5147-python-block-comment-paragraphs/not-a-comment/cmd
+++ b/test/indent/python/not-a-comment/cmd
diff --git a/test/regression/5147-python-block-comment-paragraphs/not-a-comment/in b/test/indent/python/not-a-comment/in
index bdfda4a1..bdfda4a1 100644
--- a/test/regression/5147-python-block-comment-paragraphs/not-a-comment/in
+++ b/test/indent/python/not-a-comment/in
diff --git a/test/regression/5147-python-block-comment-paragraphs/not-a-comment/out b/test/indent/python/not-a-comment/out
index 881aeaa0..881aeaa0 100644
--- a/test/regression/5147-python-block-comment-paragraphs/not-a-comment/out
+++ b/test/indent/python/not-a-comment/out
diff --git a/test/regression/5147-python-block-comment-paragraphs/not-a-comment/rc b/test/indent/python/not-a-comment/rc
index a098fc21..a098fc21 100644
--- a/test/regression/5147-python-block-comment-paragraphs/not-a-comment/rc
+++ b/test/indent/python/not-a-comment/rc
diff --git a/test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/cmd b/test/indent/python/paragraph-break-indented/cmd
index 60ee9918..60ee9918 100644
--- a/test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/cmd
+++ b/test/indent/python/paragraph-break-indented/cmd
diff --git a/test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/in b/test/indent/python/paragraph-break-indented/in
index fb95ee15..fb95ee15 100644
--- a/test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/in
+++ b/test/indent/python/paragraph-break-indented/in
diff --git a/test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/out b/test/indent/python/paragraph-break-indented/out
index 31a0fc7e..31a0fc7e 100644
--- a/test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/out
+++ b/test/indent/python/paragraph-break-indented/out
diff --git a/test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/rc b/test/indent/python/paragraph-break-indented/rc
index a098fc21..a098fc21 100644
--- a/test/regression/5147-python-block-comment-paragraphs/paragraph-break-indented/rc
+++ b/test/indent/python/paragraph-break-indented/rc
diff --git a/test/regression/5147-python-block-comment-paragraphs/paragraph-break/cmd b/test/indent/python/paragraph-break/cmd
index 60ee9918..60ee9918 100644
--- a/test/regression/5147-python-block-comment-paragraphs/paragraph-break/cmd
+++ b/test/indent/python/paragraph-break/cmd
diff --git a/test/regression/5147-python-block-comment-paragraphs/paragraph-break/in b/test/indent/python/paragraph-break/in
index c856556f..c856556f 100644
--- a/test/regression/5147-python-block-comment-paragraphs/paragraph-break/in
+++ b/test/indent/python/paragraph-break/in
diff --git a/test/regression/5147-python-block-comment-paragraphs/paragraph-break/out b/test/indent/python/paragraph-break/out
index 56da68fd..56da68fd 100644
--- a/test/regression/5147-python-block-comment-paragraphs/paragraph-break/out
+++ b/test/indent/python/paragraph-break/out
diff --git a/test/regression/5147-python-block-comment-paragraphs/paragraph-break/rc b/test/indent/python/paragraph-break/rc
index a098fc21..a098fc21 100644
--- a/test/regression/5147-python-block-comment-paragraphs/paragraph-break/rc
+++ b/test/indent/python/paragraph-break/rc