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

Misaligned Literate Idris highlightling in idris-mode #480

Closed
fabianhjr opened this issue Jun 15, 2018 · 7 comments
Closed

Misaligned Literate Idris highlightling in idris-mode #480

fabianhjr opened this issue Jun 15, 2018 · 7 comments

Comments

@fabianhjr
Copy link

> data Day = Monday
>          | Tuesday
>          | Wednesday
>          | Thursday
>          | Friday
>          | Saturday
>          | Sunday
>
> next_weekday : Day -> Day
> next_weekday d = case d of
>                      Monday    => Tuesday
>                      Tuesday   => Wednesday
>                      Wednesday => Thursday
>                      Thursday  => Friday
>                      Friday    => Saturday
>                      Saturday  => Sunday
>                      Sunday    => Monday

Steps to Reproduce

  1. Save code as Literate.lidr
  2. idris-load-file in Emacs with idris-mode

Expected Behavior

Correct highlighting

Observed Behavior

Highlighting shifts 2 places to the left. (Corresponding to the > in the editor)

screenshot from 2018-06-14 23-39-20

Software Info

idris --version: 1.3.0-git:PRE
emacs --version: GNU Emacs 26.1

Related: idris-lang/Idris-dev#1736

Crosspost from idris-lang/Idris-dev#4478

@ska80
Copy link

ska80 commented Jun 15, 2018

I don't have this issue:

screen shot 2018-06-15 at 11 58 10

idris --version: 1.3.0-git:88a9f38f
emacs --version: GNU Emacs 26.1

idris-mode: latest, installed from MELPA

@fabianhjr
Copy link
Author

Thanks @ska80, I will double check my configs to see if there is something messing with my buffer.

@andrewmcveigh
Copy link

I do have this issue, did you solve it?

@andrewmcveigh
Copy link

Seems to be down to this 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)))

Changing it to this "fixes" the offset for me.

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

Maybe something in the back end changed for .lidr?

@lrworth
Copy link

lrworth commented Nov 28, 2018

@fabianhjr @andrewmcveigh I too have this issue. Was there some resolution found before the ticket was closed?

I'm using Spacemacs with the idris layer. I can fix it the same way @andrewmcveigh suggested.

@fabianhjr
Copy link
Author

I don't remember how I fixed it but it was an issue on my end.

@jjl
Copy link

jjl commented Dec 16, 2018

I just upgraded idris-mode from melpa and see the same problem. evaluating the code by @andrewmcveigh also fixes it.

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

5 participants