cucumber.el
cucumber.el copied to clipboard
Bug at highlighting when a keyword is a prefix of another keyword
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))))
@renatofq thank you for the detailed report. Feel free to submit a PR.