From e4105d448651cd9cd572054758fad868d95d45b8 Mon Sep 17 00:00:00 2001 From: Stefan Lehmann Date: Wed, 9 Sep 2015 16:38:38 +0200 Subject: [PATCH] Update FileHeader.py Fix proposal for solving issue #37. Don' t know if return is the best way to solve it. --- FileHeader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/FileHeader.py b/FileHeader.py index edcc4f7..701bf1f 100644 --- a/FileHeader.py +++ b/FileHeader.py @@ -601,13 +601,15 @@ def update_automatically(self, view, what): if search is not None: var = search.group() index = line.find(var) - + line_header = None + for i in range(index - 1, 0, -1): if line[i] != ' ': space_start = i + 1 line_header = line[:space_start] break - + if line_header is None: + return line_header = re.escape(line_header) if what == LAST_MODIFIED_BY or what == FILE_NAME or \ what == FILE_NAME_WITHOUT_EXTENSION or \