Closes https://github.com/zed-industries/zed/issues/25416 Release Notes: - Fixed a bug where indentation was applied when adding a newline to a Python comment ending in `:`.
20 lines
880 B
TOML
20 lines
880 B
TOML
name = "Python"
|
|
grammar = "python"
|
|
path_suffixes = ["py", "pyi", "mpy"]
|
|
first_line_pattern = '^#!.*\bpython[0-9.]*\b'
|
|
line_comments = ["# "]
|
|
autoclose_before = ";:.,=}])>"
|
|
brackets = [
|
|
{ start = "\"\"\"", end = "\"\"\"", close = true, newline = false, not_in = ["string"] },
|
|
{ start = "'''", end = "'''", close = true, newline = false, not_in = ["string"] },
|
|
{ start = "{", end = "}", close = true, newline = true },
|
|
{ start = "[", end = "]", close = true, newline = true },
|
|
{ start = "(", end = ")", close = true, newline = true },
|
|
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["string"] },
|
|
{ start = "'", end = "'", close = true, newline = false, not_in = ["string"] },
|
|
]
|
|
|
|
auto_indent_using_last_non_empty_line = false
|
|
increase_indent_pattern = "^[^#].*:\\s*$"
|
|
decrease_indent_pattern = "^\\s*(else|elif|except|finally)\\b.*:"
|