diff --git a/rc/filetype/python.kak b/rc/filetype/python.kak index d7b09aa7..7f44897d 100644 --- a/rc/filetype/python.kak +++ b/rc/filetype/python.kak @@ -36,6 +36,7 @@ provide-module python %ยง add-highlighter shared/python regions add-highlighter shared/python/code default-region group add-highlighter shared/python/docstring region -match-capture ^\h*("""|''') (?>> \K' '\z' ref python -add-highlighter shared/python/docstring/ region '\.\.\. \K' '\z' ref python +add-highlighter shared/python/docstring/ region '(>>>|\.\.\.) \K' (?=''')|(?=""") ref python evaluate-commands %sh{ # Grammar diff --git a/test/regression/1920-crash-on-python-in-docstring/script b/test/regression/1920-crash-on-python-in-docstring/script index a064fef7..260ebb03 100644 --- a/test/regression/1920-crash-on-python-in-docstring/script +++ b/test/regression/1920-crash-on-python-in-docstring/script @@ -1,5 +1,5 @@ ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }' -ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": "\"" }, { "face": { "fg": "magenta", "bg": "default", "attributes": [] }, "contents": "\"\">>> " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\"\"\"\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' +ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": ["final_fg","final_bg"] }, "contents": "\"" }, { "face": { "fg": "cyan", "bg": "default", "attributes": [] }, "contents": "\"\">>> \"\"\"" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] }' ui_out '{ "jsonrpc": "2.0", "method": "menu_hide", "params": [] }' ui_out '{ "jsonrpc": "2.0", "method": "info_hide", "params": [] }' ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }'