borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
558 stars 18 forks source link

Markdown is line-breaking by letter instead of by word #200

Open Sawtaytoes opened 5 years ago

Sawtaytoes commented 5 years ago

For whatever reason, Naomi's Markdown is breaking lines at the letter instead of by the word. I used other Markdown extensions in the past and didn't have this issue so I dunno what's going on.

image

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.
Sawtaytoes commented 5 years ago

The fix is to change match in entry to this instead of "":

  entry:
    - include: Packages/Naomi/syntaxes/md1/header.sublime-syntax
    - include: Packages/Naomi/syntaxes/md1/code-block.sublime-syntax
    - match: |-
        (?x)^
        (?= [ ]{,3}>
        | ([ ]{4}|\t)(?!$)
        | [#]{1,6}\s*+
        | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
        )
      pop: true

Why? I have absolutely no clue, but that's what MarkdownEditing does in their code, and that simple change fixes the issue.

image