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

Syntax highlighting failure #217

Closed
skontar opened this Issue Aug 29, 2016 · 7 comments

Comments

Projects
None yet
4 participants
@skontar
Copy link

skontar commented Aug 29, 2016

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

@zyedidia

This comment has been minimized.

Copy link
Owner

zyedidia commented Aug 29, 2016

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.

@skontar

This comment has been minimized.

Copy link

skontar commented Aug 29, 2016

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!

@zyedidia zyedidia added the bug label Sep 2, 2016

@sinkevichmm

This comment has been minimized.

Copy link

sinkevichmm commented Oct 9, 2016

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

@zyedidia

This comment has been minimized.

Copy link
Owner

zyedidia commented Oct 9, 2016

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).

@sinkevichmm

This comment has been minimized.

Copy link

sinkevichmm commented Oct 10, 2016

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

@evolbug

This comment has been minimized.

Copy link

evolbug commented Feb 1, 2017

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.

@zyedidia

This comment has been minimized.

Copy link
Owner

zyedidia commented Mar 27, 2017

Fixed in #593.

@zyedidia zyedidia closed this Mar 27, 2017

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