rpdillon / todotxt.el

A todo.txt client for Emacs
55 stars 18 forks source link

highlight line mode will make get current line wrong #29

Closed pyluyten closed 4 years ago

pyluyten commented 5 years ago

If you use the mode to highlight current line, then the todotxt internal to get current line as string will be wrong and pick up the following row instead current one. In my setup i added an uggly "if" to solve this

ComedyTomedy commented 5 years ago

The problem's in todotxt-find-next-visible-char

We need to replace (overlays-at (point)) with (filter (lambda (overlay) (member 'invisible (overlay-properties overlay))) (overlays-at (point))) or something, with the minor problem being that emacs doesn't have a filter function without cl-lib or seq (neither of which are used in todotxt currently)

ComedyTomedy commented 5 years ago

Related issue is that hl-line-mode doesn't highlight anything if the cursor is on an invisible line. But then... oh well

pyluyten commented 5 years ago

if cl-lib dep is an issue ; you might be able to deactive hl-line mode for todotxt buffer only ?

ComedyTomedy commented 5 years ago

I'll submit a pull request later, but the simple solution is to replace

(while (not (equal (overlays-at (point)) nil))

with

(while (invisible-p (point))

in todotxt-find-next-visible-char

rneatherway commented 4 years ago

I've hit this too and it would be nice to get a fix up on MELPA. @rpdillon what do you think about either merging one of the two fixes in PRs #30 and #31 or alternatively adding one of the authors as a maintainer?

rneatherway commented 4 years ago

Thanks very much for merging :-)