From d2a9a9d7254ea6a0402134c293ed99251e448f81 2018-10-11 10:57:34 From: Matthias Geier Date: 2018-10-11 10:57:34 Subject: [PATCH] Same highlighting for %%file as for %%writefile ... because former is an alias for latter. --- diff --git a/IPython/lib/lexers.py b/IPython/lib/lexers.py index b8dec7e..fd42880 100644 --- a/IPython/lib/lexers.py +++ b/IPython/lib/lexers.py @@ -98,6 +98,7 @@ def build_ipy_lexer(python3): (r'(?s)(\s*)(%%time)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), (r'(?s)(\s*)(%%timeit)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), (r'(?s)(\s*)(%%writefile)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r'(?s)(\s*)(%%file)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), (r"(?s)(\s*)(%%)(\w+)(.*)", bygroups(Text, Operator, Keyword, Text)), (r'(?s)(^\s*)(%%!)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(BashLexer))), (r"(%%?)(\w+)(\?\??)$", bygroups(Operator, Keyword, Operator)),