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

Bug at highlighting when a keyword is a prefix of another keyword #65

Open
renatofq opened this issue Feb 16, 2016 · 1 comment
Open

Comments

@renatofq
Copy link

When a keyword is a prefix to another keyword, the longer keyword does not get fully highlighted.

Example: in Portuguese the keyword 'E' (And) is a prefix of the keyword 'Então' (Then). Also, 'And' happens before 'Then' on the keyword name list, so when using feature-mode in Portuguese, only the letter 'E' gets highlighted when I insert 'Então'.

I think that sorting the keywords making the longer first is a proper way to fix. I would submit a PR, but my lisp is very poor, so I'm going to paste how I got it to work.

feature-mode.el
439c439,442
<     result-keywords))

---
>     (sort result-keywords 'longer-first)))
> 
> (defun longer-first (a b)
>   (> (length (car a)) (length (car b))))
@michaelklishin
Copy link
Owner

@renatofq thank you for the detailed report. Feel free to submit a PR.

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