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

Syntax highlighting failure #217

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

Syntax highlighting failure #217

skontar opened this issue Aug 29, 2016 · 7 comments
Labels

Comments

@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
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
Copy link
Author

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
Copy link

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

@zyedidia
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
Copy link

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

@evolbug
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
Copy link
Owner

Fixed in #593.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants