Skip to content

Commit b1c7071

Browse files
committed
handle # ifdef (with spaces) correctly
Sometimes people write `# ifdef BLAH` instead of `#ifdef BLAH`, putting few spaces after # . Now the plugin handles it correctly
1 parent 5a09529 commit b1c7071

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

simpleifdef.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def _rescan(self, view):
3434
for r in regions:
3535
s = view.substr(r)
3636

37+
if s.startswith('# '):
38+
s = s.replace(' ', '')
39+
3740
if s.startswith('#if'):
3841
self._regions.append(r)
3942
stack.append({(r.a, r.b)}) # Region is not hashable

0 commit comments

Comments
 (0)