Skip to content

Syntax highlighting failure #217

Closed
Closed

Description

@skontar

Hi. First, thank you for the neat editor!

I have found an issue with syntax highlighter, when sometimes it sets the whole view to "comment" under some circumstances.

To reproduce:

The file to open:
https://github.com/skontar/update-checker/blob/a810f6b71449dbbc03d033fc598f48151892a799/update_checker.py

The terminal size:
80x24 (xfce4-terminal)

Scroll so these lines are the only visible:
83-104

See the screenshot for details.

screenshot_2016-08-29_15-32-42

Activity

  1. zyedidia commented on Aug 29, 2016

    @zyedidia
    Member

    Hmm unfortunately there is nothing I can do about this without making a lot of changes to the syntax highlighting engine. I do plan on making the changes, but I can't do it right now.

    The issue is caused by micro only checking a subset of the buffer for syntax highlighting (for speed purposes), but since Python uses """ for both starting a comment and ending a comment, micro can't know if a """ is the start of a comment, or if it is the end of a comment which started out of the subset being checked.

  2. skontar commented on Aug 29, 2016

    @skontar
    Author

    Understood. Hopefully you will be able to fix that in the future by some clever optimization. Unfortunately I know nothing about Go, so I cannot help. Keep up great work, you have saved me from Nano and Vim suffering!

  3. sinkevichmm commented on Oct 9, 2016

    @sinkevichmm

    I have a similar error on the left to the right Тerminator Gnome Terminal
    Shell: Fish
    2016-10-09 21-53-17

  4. zyedidia commented on Oct 9, 2016

    @zyedidia
    Member

    That seems like syntax highlighting is simply not working in Terminator. This is probably because your TERM variable is set to xterm. You can fix this by settings TERM=xterm-256color or by changing the colorscheme in micro to simple (> set colorscheme simple).

  5. sinkevichmm commented on Oct 10, 2016

    @sinkevichmm

    Thank you! it helped me
    TERM=xterm-256color

  6. evolbug commented on Feb 1, 2017

    @evolbug

    After reloading and then saving a file the syntax highlighting fails entirely and no subsequently opened files are highlighted. When multiple tabs/splits are open, it fails on the saved one, other splits/tabs retain highlighted state until they are saved.

  7. zyedidia commented on Mar 27, 2017

    @zyedidia
    Member

    Fixed in #593.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions