Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package should ignore after hyphenation #205

Open
1 task done
JackSwett opened this issue May 23, 2019 · 0 comments
Open
1 task done

Package should ignore after hyphenation #205

JackSwett opened this issue May 23, 2019 · 0 comments

Comments

@JackSwett
Copy link

JackSwett commented May 23, 2019

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)

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

No branches or pull requests

1 participant