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

Bad syntax highlighting of .lidr files #506

Open
nicolabotta opened this issue Dec 29, 2019 · 3 comments
Open

Bad syntax highlighting of .lidr files #506

nicolabotta opened this issue Dec 29, 2019 · 3 comments

Comments

@nicolabotta
Copy link

Syntax highlighting works fine on .idr files but on .lidr files (Bird style), I get something like this:

Screenshot_2019-12-29_15-31-02

Is there a way to get the same highlighting on .idr files and .lidr files? Thanks + cheers, Nicola

@david-christiansen
Copy link
Member

david-christiansen commented Dec 29, 2019 via email

@nicolabotta
Copy link
Author

Thanks David, I have opened idris-lang/Idris-dev#4799 (comment). Best, Nicola

@nicolabotta
Copy link
Author

As reported in idris-lang/Idris-dev#4799 (comment), there seem to be two problems in the current idris-mode.

For syntax highlighting to work as expected for .lidr files, the function

(defun idris-highlight-column (idris-col)
  "Compute the Emacs position offset of the Idris column IDRIS-COL, for highlighting.                                     
                                                                                                                          
In particular, this takes bird tracks into account in literate Idris."
  (+ idris-col (if (idris-lidr-p) 1 -1)))

had to be modified as suggested by andrewmcveigh in #480 as

(defun idris-highlight-column (idris-col)
  "Compute the Emacs position offset of the Idris column IDRIS-COL, for highlighting.                                     
                                                                                                                          
In particular, this takes bird tracks into account in literate Idris."
  (+ idris-col (if (idris-lidr-p) -1 -1)))

and loaded. The second problem is that the file that defines idris-highlight-column, idris-highlight-input.el, is not loaded when idris-mode is started. Thus, just modifying the function has no effect when idris-mode is loaded in a fresh emacs instance. One has to manually load idris-highlight-input.el for syntax highlighting to work as expected. Cheers, Nicola

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

2 participants