Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Syntax highlighting for keywords at the beginning of line does not work #70

Open
moxaj opened this issue Jun 24, 2017 · 2 comments
Open
Labels

Comments

@moxaj
Copy link
Contributor

moxaj commented Jun 24, 2017

Description

^ Title.

Steps to Reproduce

Type any keyword at the beginning of a line.

Expected behavior: [What you expect to happen]

Keyword hightlighted as a keyword (constant.keyword.clojure)

Actual behavior: [What actually happens]

Keyword is not highlighted as a keyword.

Reproduces how often: [What percentage of the time does it reproduce?]

Always.

Versions

Any version.

Additional Information

Relevant regex:

'(?<=(\\s|\\(|\\[|\\{)):[a-zA-Z0-9\\#\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))'

The positive lookbehind states that the colon should be preceded by a whitespace, (, [ or a [ character. Obviously neither of those precede the colon when the keyword is at the beginning of a line. Adding the word boundary anchor (\b) to the possible characters would fix it, however the regex engine cannot handle variable-length lookbehinds.

@50Wliu
Copy link
Contributor

50Wliu commented Jul 8, 2017

Wouldn't adding ^ (start-of-line) fix it?

@50Wliu 50Wliu added the bug label Jul 8, 2017
@moxaj
Copy link
Contributor Author

moxaj commented Jul 8, 2017

I think that'd still count as variable-length lookbehind (^ probably counts as zero length).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants