[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 3415b7ac08 321/372: - changed behaviour when user
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 3415b7ac08 321/372: - changed behaviour when user is annotation a newline character; |
Date: |
Fri, 4 Feb 2022 16:59:15 -0500 (EST) |
branch: elpa/annotate
commit 3415b7ac0841397d1e00cc0d169f60c831f88965
Author: cage <cage@localhost>
Commit: cage <cage@invalid>
- changed behaviour when user is annotation a newline character;
update an existing annotation on the line that terminate with the newline
the user is annotation only if the existing annotation spans the whole
line.
---
annotate.el | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/annotate.el b/annotate.el
index dc32b61377..908f44e875 100644
--- a/annotate.el
+++ b/annotate.el
@@ -604,24 +604,30 @@ specified by `from' and `to'."
(annotate--cut-left-annotation last-of-chain-to-cut)))
(when delete-enclosed
(annotate-delete-chains-in-region chain-end region-stop))))
+ (annotate-overwrite-line (eol bol)
+ (goto-char bol)
+ (push-mark (point) t t)
+ (goto-char eol)
+ (annotate-annotate))
(annotate-line (eol)
(let* ((bol
(annotate-beginning-of-line-pos))
(annotations-on-the-line
(annotate-annotations-overlay-in-range bol
eol)))
(if (= (length annotations-on-the-line)
1)
- (let* ((annotation (cl-first annotations-on-the-line))
- (start-overlay (overlay-start annotation))
- (end-overlay (overlay-end annotation)))
- (goto-char end-overlay)
- (push-mark start-overlay t t)
- (annotate-change-annotation (overlay-start annotation))
- (pop-mark))
- (progn
- (goto-char bol)
- (push-mark (point) t t)
- (goto-char eol)
- (annotate-annotate))))))
+ (let* ((annotation (cl-first
annotations-on-the-line))
+ (start-overlay (overlay-start
annotation))
+ (end-overlay (overlay-end
annotation))
+ (annotation-spans-whole-line-p (and (=
start-overlay bol)
+ (=
end-overlay eol))))
+ (if annotation-spans-whole-line-p
+ (progn
+ (goto-char end-overlay)
+ (push-mark start-overlay t t)
+ (annotate-change-annotation (overlay-start
annotation))
+ (pop-mark))
+ (annotate-overwrite-line bol eol)))
+ (annotate-overwrite-line bol eol)))))
(let ((annotation (annotate-annotation-at (point))))
(cond
((use-region-p)
@@ -676,9 +682,11 @@ specified by `from' and `to'."
(save-excursion
(let* ((bol (annotate-beginning-of-line-pos))
(eol (point)))
- (if (/= eol bol)
+ (if (/= eol bol) ; text before the newline,
annotate it
(annotate-line eol)
- (progn
+ (progn ; no text before the new
+ ; line, annotate next line
+ ; with proper text
(forward-line 1)
(goto-char (annotate-end-of-line-pos))
(annotate-annotate))))))))))))
- [nongnu] elpa/annotate 401dab7723 291/372: - updated README, Changelog and version number., (continued)
- [nongnu] elpa/annotate 401dab7723 291/372: - updated README, Changelog and version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 44ac24f63d 274/372: Merge pull request #87 from cage2/overwrite-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 8b06586497 282/372: - fixed integration of multiline annotated text., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 485060813b 277/372: - added procedures to pad multiline annotation text., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e004ae7e97 281/372: - updated version;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3e5d14fde8 287/372: - updated documentation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6415fb6111 294/372: - updated NEWS and CHANGELOG;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4890d2d2a2 295/372: Merge pull request #95 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 85d7c87e08 293/372: - added padding also for notes placed on the margin of the window., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ac55086d60 301/372: - fixed typo., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3415b7ac08 321/372: - changed behaviour when user is annotation a newline character;,
ELPA Syncer <=
- [nongnu] elpa/annotate f33eecba7b 362/372: - prevented asking to delete a database that does not actually exists, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1350e1d073 338/372: - fixed annotated text shown in the summary window, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3e3c1b1066 368/372: - fixed function name;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a484ffa0b6 319/372: - allowed removing (or cutting) annotations when buffer is in read-only mode., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 936389e36a 316/372: - prevented asking for annotation when trying to annotate a newline character., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 36d3729c27 339/372: - updated version number and docs., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a8762cd08a 344/372: - removed garbage at the end of an error message., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9aba6305fe 342/372: Merge pull request #109 from cage2/fix-replace-button, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate bd12129213 333/372: Merge pull request #106 from cage2/fixed-call-comment-region, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 83e81e0979 369/372: - added missing docstrings and improved a bit the old ones., ELPA Syncer, 2022/02/04