Skip to content

Package should ignore after hyphenation #205

@JackSwett

Description

@JackSwett

Prerequisites

  • Put an X in this box if you have done the following:
    • Ensured the issue has not already been raised
    • Ensured the issue is caused by this package

Description

Text inside the brackets after the \hyphenation command are processed as normal text and therefore get spell-checked.

Steps to reproduce & Minimum working example

  1. Put \hyphenation{op-tical net-works semi-conduc-tor} near the top of your file.
  2. Spell check with linter-spell and linter-spell-latex

Expected behaviour

tical and conduc are marked as mispelled.

Actual behaviour

tical and conduc are marked as mispelled.

Additional information

I have solved the issue by adding the following to grammars/latex.cson.

EDIT: This seems to work the first time I relaunch Atom, then it doesn't work after....

  {
    'captures':
      '1':
        'name': 'support.function.be.latex'
      '2':
        'name': 'punctuation.definition.function.latex'
      '3':
        'name': 'support.function.general.tex'
    'comment': 'This matches the hyphenation command to force proper hyphenation'
    'match': '(?:\\s*)((\\\\)hyphenation)({(.{1,1000})})'
    'name': 'meta.function.hyphenation.latex'
  }

This should be added to the code, but I'm not very good at RegEx, so I wanted to post here. There is probably a better way than what I did. Obviously if you have over 1000 characters to correct hyphenation on, you should probably use shorter words as this fix won't work. Is there a better RegEx to use? (the 1,1000 seems clunky)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions