From b2b81359c3e271f7ea835fd1ba25bd2ca59514d9 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 15 Jul 2017 21:03:53 -0700 Subject: [PATCH 1/3] Python: Don't highlight sub-identifiers as keywords For example, highlight `file` as a builtin when appearing by itself, but not in a construct like `obj.file`. Fixes #1542. --- data/filedefs/filetypes.python | 1 + 1 file changed, 1 insertion(+) diff --git a/data/filedefs/filetypes.python b/data/filedefs/filetypes.python index 03df32028f..74f2bd0f23 100644 --- a/data/filedefs/filetypes.python +++ b/data/filedefs/filetypes.python @@ -34,6 +34,7 @@ identifiers=ArithmeticError AssertionError AttributeError BaseException Blocking [lexer_properties] fold.comment.python=1 fold.quotes.python=1 +lexer.python.keywords2.no.sub.identifiers=1 [settings] # default extension used when saving files From c03af5b4348c16ee8da3508fc07cf9551a8a1792 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Wed, 19 Jul 2017 22:02:17 -0700 Subject: [PATCH 2/3] Python: Remove obsolete lexer property --- data/filedefs/filetypes.python | 1 - 1 file changed, 1 deletion(-) diff --git a/data/filedefs/filetypes.python b/data/filedefs/filetypes.python index 74f2bd0f23..61a3c11ccd 100644 --- a/data/filedefs/filetypes.python +++ b/data/filedefs/filetypes.python @@ -32,7 +32,6 @@ primary=False None True and as assert break class continue def del elif else exc identifiers=ArithmeticError AssertionError AttributeError BaseException BlockingIOError BrokenPipeError BufferError BytesWarning ChildProcessError ConnectionAbortedError ConnectionError ConnectionRefusedError ConnectionResetError DeprecationWarning EOFError Ellipsis EnvironmentError Exception FileExistsError FileNotFoundError FloatingPointError FutureWarning GeneratorExit IOError ImportError ImportWarning IndentationError IndexError InterruptedError IsADirectoryError KeyError KeyboardInterrupt LookupError MemoryError NameError NotADirectoryError NotImplemented NotImplementedError OSError OverflowError PendingDeprecationWarning PermissionError ProcessLookupError ReferenceError ResourceWarning RuntimeError RuntimeWarning StandardError StopIteration SyntaxError SyntaxWarning SystemError SystemExit TabError TimeoutError TypeError UnboundLocalError UnicodeDecodeError UnicodeEncodeError UnicodeError UnicodeTranslateError UnicodeWarning UserWarning ValueError Warning ZeroDivisionError __build_class__ __debug__ __doc__ __import__ __loader__ __name__ __package__ __spec__ abs all any apply ascii basestring bin bool buffer bytearray bytes callable chr classmethod cmp coerce compile complex copyright credits delattr dict dir divmod enumerate eval execfile exit file filter float format frozenset getattr globals hasattr hash help hex id input int intern isinstance issubclass iter len license list locals long map max memoryview min next object oct open ord pow property quit range raw_input reduce reload repr reversed round set setattr slice sorted staticmethod str sum super tuple type unichr unicode vars xrange zip [lexer_properties] -fold.comment.python=1 fold.quotes.python=1 lexer.python.keywords2.no.sub.identifiers=1 From 8b25d09978a5e37e2918a130add3a700111c6a0f Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Wed, 19 Jul 2017 22:07:13 -0700 Subject: [PATCH 3/3] Cython: Inherit lexer properties from the Python filetype --- data/filedefs/filetypes.Cython.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/filedefs/filetypes.Cython.conf b/data/filedefs/filetypes.Cython.conf index 5d8a14dbb4..402c504e91 100644 --- a/data/filedefs/filetypes.Cython.conf +++ b/data/filedefs/filetypes.Cython.conf @@ -4,6 +4,8 @@ primary=and as assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass print raise return try while with yield False None True api by cdef cimport cpdef ctypedef enum extern gil include inline nogil property public readonly struct union DEF IF ELIF ELSE NULL bint char Py_ssize_t short size_t void double int real long complex identifiers=ArithmeticError AssertionError AttributeError BaseException BufferError BytesWarning DeprecationWarning EOFError Ellipsis EnvironmentError Exception False FloatingPointError FutureWarning GeneratorExit IOError ImportError ImportWarning IndentationError IndexError KeyError KeyboardInterrupt LookupError MemoryError NameError None NotImplemented NotImplementedError OSError OverflowError PendingDeprecationWarning ReferenceError RuntimeError RuntimeWarning StandardError StopIteration SyntaxError SyntaxWarning SystemError SystemExit TabError True TypeError UnboundLocalError UnicodeDecodeError UnicodeEncodeError UnicodeError UnicodeTranslateError UnicodeWarning UserWarning ValueError Warning ZeroDivisionError __debug__ __doc__ __import__ __name__ __package__ abs all any apply basestring bin bool buffer bytearray bytes callable chr classmethod cmp coerce compile complex copyright credits delattr dict dir divmod enumerate eval execfile exit file filter float format frozenset getattr globals hasattr hash help hex id input int intern isinstance issubclass iter len license list locals long map max min next object oct open ord pow print property quit range raw_input reduce reload repr reversed round set setattr slice sorted staticmethod str sum super tuple type unichr unicode vars xrange zip +[lexer_properties=Python] + [settings] lexer_filetype=Python tag_parser=Python