Skip to content

Commit

Permalink
Improve interaction with symbol list
Browse files Browse the repository at this point in the history
  • Loading branch information
ISSOtm committed Feb 26, 2020
1 parent 58d6c7a commit c452bf8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
22 changes: 22 additions & 0 deletions Symbol List - Section.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Symbol List: Section</string>
<key>scope</key>
<string>markup.heading.1.mandoc, markup.heading.2.mandoc</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
<string><![CDATA[
s/\s*$//;
s/^[.']Sh\s+//;
s/^[.']Ss\s+/ /; # Make subsections stand out as such
s/(?<=\s)(?:Ac|Ao|Bc|Bo|Brc|Bro|Dc|Do|Ec|Eo|Fc|Oc|Oo|Pc|Po|Qc|Qo|Sc|So|Xc|Xo|Aq|Bq|Brq|Dq|Op|Pq|Ql|Qq|Sq|Vt|Ad|An|Ap|Ar|At|Bsx|Bx|Cd|Cm|Dv|Dx|Em|Er|Ev|Fa|Fl|Fn|Ft|Fx|Ic|Lk|Ms|Mt|Nm|No|Ns|Nx|Ox|Pa|Pf|Sx|Sy|Va|Vt|Xr|E[ns]|Fr|Li|Ot|Tn|Ux)\s+//g;
]]></string>
</dict>
</dict>
</plist>
8 changes: 2 additions & 6 deletions mandoc.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,9 @@ contexts:
- match: ^[.\']Sh(?=\s)
scope: keyword.mandoc
push:
- meta_scope: markup.heading.mandoc
- meta_scope: markup.heading.1.mandoc
- meta_content_scope: entity.name.section.mandoc
- include: callable_macro
- match: (?<=\s)\S+(?=\s)
scope: meta.toc-list.mandoc
- match: $\n?
set:
- meta_content_scope: meta.block.section.mandoc
Expand All @@ -289,11 +287,9 @@ contexts:
- match: ^[.\']Ss(?=\s)
scope: keyword.mandoc
push:
- meta_scope: markup.heading.mandoc
- meta_scope: markup.heading.2.mandoc
- meta_content_scope: entity.name.section.mandoc
- include: callable_macro
- match: (?<=\s)\S+(?=\s)
scope: meta.toc-list.mandoc
- match: $\n?
set:
- meta_content_scope: meta.block.sub-section.mandoc
Expand Down

0 comments on commit c452bf8

Please sign in to comment.