branch: externals/ampc commit 204540b0decdb66f4ce0b617914b67952b0d9996 Author: Christopher Schmidt <christop...@ch.ristopher.com> Commit: Christopher Schmidt <christop...@ch.ristopher.com>
* ampc.el (ampc-fill-internal-db): Fix empty region bug. --- ampc.el | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ampc.el b/ampc.el index d2080c0dae..ef049911ff 100644 --- a/ampc.el +++ b/ampc.el @@ -1174,18 +1174,16 @@ all the time!" (line-beginning-position)) then next while origin - for next = (progn - (forward-char) - (and (search-forward-regexp "^file: " nil t) - (move-beginning-of-line nil))) - while next + do (goto-char (1+ origin)) + for next = (and (search-forward-regexp "^file: " nil t) + (line-beginning-position)) + while (or (not running) next) do (save-restriction - (narrow-to-region origin next) + (narrow-to-region origin (or next (point-max))) (ampc-fill-internal-db-entry)) - (goto-char origin) - (when running - (delete-region origin next) - (setf next origin)))) + do (when running + (delete-region origin next) + (setf next origin)))) (defun ampc-tags () (loop for w in (ampc-windows)