mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-19 06:43:06 +02:00
VimwikiTask: Any header terminates search for viewport
This commit is contained in:
parent
c474a7c958
commit
0f50979a42
2 changed files with 14 additions and 0 deletions
|
@ -60,6 +60,14 @@ GENERIC_VIEWPORT = re.compile(
|
|||
'[=]+' # Header ending
|
||||
)
|
||||
|
||||
GENERIC_HEADER = re.compile(
|
||||
'^' # Starts at the beginning of the line
|
||||
'[=]+' # With a positive number of =
|
||||
'[^=]+' # Character other than =
|
||||
'[=]+' # Positive number of =, closing the header
|
||||
'\s*' # Allow trailing whitespace
|
||||
)
|
||||
|
||||
ANSI_ESCAPE_SEQ = re.compile(
|
||||
'\x1b' # literal ESC
|
||||
'\[' # literal [
|
||||
|
|
|
@ -351,3 +351,9 @@ class VimwikiTask(object):
|
|||
|
||||
# If port was detected, break the search
|
||||
break
|
||||
|
||||
# If line matches any header that is not a viewport,
|
||||
# break the search too
|
||||
line = self.cache.buffer[i]
|
||||
if re.match(regexp.GENERIC_HEADER, line):
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue