orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
655 stars 39 forks source link

The property `buffer.eol_annotation_style` sets the wrong style #271

Closed davidvontamar closed 2 years ago

davidvontamar commented 2 years ago

The function buffer:style_of_name("comment") returns the style number associated with the style comment, whose index is 2. However, the following code:

buffer.eol_annotation_style[issue.line] = buffer:style_of_name("comment")

will result in these annotations using the string style, whose index is 3. Instead, the following code:

buffer.eol_annotation_style[issue.line] = buffer:style_of_name("comment") - 1

corrects the style selection to comment. I've tested buffer:style_of_name("comment") and it indeed returns 2, the correct index for comment (as Ctrl+I indicates). Therefore, the problem must be with buffer.eol_annotation_style.

orbitalquark commented 2 years ago

You are correct, thanks for the report.

orbitalquark commented 2 years ago

Fixed via https://github.com/orbitalquark/textadept/commit/8fdd8273adf5c68be4a90503aa8aa26021e2c808