Skip to content

Fix XYZ syntax highlighting contexts - #78

Merged
mveril merged 1 commit into
mainfrom
fix/xyz-syntax-contexts
Sep 19, 2026
Merged

mveril merged 1 commit into
mainfrom
fix/xyz-syntax-contexts

Conversation

@mveril

@mveril mveril commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Model XYZ highlighting as explicit main, comment, and atoms contexts.
  • Keep the second XYZ line entirely in a comment scope so numbers in method names, basis sets, and URLs are not highlighted as coordinates.
  • Restrict coordinate highlighting to complete atom records.
  • Support concatenated XYZ frames by switching back to the comment context when a new atom-count line is encountered.
  • Use variable.other.atom.xyz for atom symbols instead of entity.name.atom.xyz.

Before

24
Anthracene, B3PW91/6-31G(d,p) geometry, https://...
C  -6.199447  -0.542799  -0.014381

The generic numeric rule also highlighted numbers in the free-form comment line.

After

24                                      # atom count
Anthracene, B3PW91/6-31G(d,p) ...       # comment
C  -6.199447  -0.542799  -0.014381      # atom + coordinates

Only atom counts and coordinates receive numeric scopes, while the XYZ comment remains a single comment scope.

Verification

  • Compared the branch against main; only assets/syntaxes/XYZ.sublime-syntax is changed.
  • CI will rebuild the embedded bat syntax assets and run the repository checks.

@mveril
mveril merged commit 319f633 into main Sep 19, 2026
8 checks passed
@mveril
mveril deleted the fix/xyz-syntax-contexts branch September 19, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant