Skip to content

Commit

Permalink
Merge pull request #84 from cage2/fix-regression-multiline-annotations
Browse files Browse the repository at this point in the history
Fixed a regression  and some bugs related to  incorrect calculation of multiline annotations.

Also closes #68
  • Loading branch information
cage2 authored Nov 23, 2020
2 parents be998ca + 0b71184 commit 9320918
Show file tree
Hide file tree
Showing 3 changed files with 297 additions and 49 deletions.
120 changes: 120 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,123 @@
2020-11-22 cage

* annotate.el:

- added more docstrings.

2020-11-12 cage

* annotate.el:

- prevented getting shared value for 'annotate-file' in
'%load-annotation-data'.

This way we can ensure that 'annotate-file' can be declared
buffer-local and different annotation databases can be used from
different buffers.

2020-11-11 cage

* annotate.el:
- fitted 'annotate-position-inside-chain-p' into 'annotate--position-inside-annotated-text-p';
- fixed some typos.

2020-11-06 cage

* annotate.el:

- Fixed a regression and some bugs related to
incorrect calculation of of multiline annotations.

To reproduce the bugs:

legend:

a = annotated text
* = non annotated text

- First bug

Create a multiline annotation using region.

aaaa
aaaa
aaaa ####

Place the cursor as below.

aaaa
^ cursor
aaaa
aaaa ####

type a character

a****
aaaa
aaaa ####

The annotated text has a "gap"

Fix proposed: revert to the old (correct behaviour)

Second bug

aaaa
aaaa
aaaa ####

Place the cursor as below.

aaaa
^ cursor on the first column
aaaa
aaaa ####

type some text

***
aaa
aaa ####

Save (C-x C-s)

you get an error on the echo area: "let*: Wrong type argument:
overlayp, nil" and the annotations are not correctly saved.

Fix proposed: remove the offending code.

Third bug

a multiline bug as before

aaaa
aaaa
aaaa ####

place the cursor here:

aaaa
aaaa
^ cursor
aaaa ####

type some text

aaaa
*****
aaaa ####

Then annotate the same line (C-c C-a):

aaaa
aaaa ####
aaaa ####

we introduced a annotation in the gap of the already existing
multiline annotation.

Fix proposed: prevents annotating text inside an annotation.

2020-09-29
* README.org, annotate.el
- updated README;
Expand Down
17 changes: 17 additions & 0 deletions NEWS.org
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,20 @@
- 2020-09-29 V0.9.0 Bastian Bechtold, cage ::
Added two new styles to render the annotation: using "pop-up" style
or via a specializated summary window.

- 2020-11-20 V0.9.2 Bastian Bechtold, cage ::

This version fix a regression and some more bug that could breaks a
multiline annotation in ways that makes the annotation system
inconsistent and renders the annotated text in wrong way (for
details see the Changelog).

The 'annotate-file' can be now safely declared buffer-local so that
multiple databases of annotations can be used on a per-buffer basis.

For pratical applications see:

https://github.com/bastibe/annotate.el/issues/68

Many thanks to gopar for spotting this elusive bug and help testing
the patch! :)
Loading

0 comments on commit 9320918

Please sign in to comment.