Skip to content

Fix invisibility check for some cases#371

Open
dvzubarev wants to merge 1 commit into
abo-abo:masterfrom
dvzubarev:invis-fix
Open

Fix invisibility check for some cases#371
dvzubarev wants to merge 1 commit into
abo-abo:masterfrom
dvzubarev:invis-fix

Conversation

@dvzubarev

Copy link
Copy Markdown
Contributor

Old avy--visible-p couldn't handle properly such case: (get-char-property s 'invisible) returns t;
buffer-invisibility-spec is set to ((outline . t) t)

from buffer-invisibility-spec documentation:

The list can have two kinds of elements:
ATOM and (ATOM . ELLIPSIS).
A text character is invisible if its invisible property is ATOM 

Check for invisibility was taken from the Emacs function count-lines.

Old avy--visible-p couldn't handle properly such case:
`(get-char-property s 'invisible)` returns t;
buffer-invisibility-spec is set to `((outline . t) t)`

from buffer-invisibility-spec documentation:
`
The list can have two kinds of elements:
ATOM and (ATOM . ELLIPSIS).
A text character is invisible if its invisible property is ATOM
`
Check for invisibility was taken from the Emacs function count-lines.
@aikrahguzar

Copy link
Copy Markdown

I was wondering about this: can't avy--visible-p be just be

(defun avy--visible-p (s)
  (not (invisible-p s)))

or are there cases which invisible-p doesn't handle. package-lint doesn't seem to think that using invisible-p requires raising the min Emacs version.

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

Successfully merging this pull request may close these issues.

2 participants