diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-05-17 06:19:20 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-05-17 06:19:20 +0200 |
commit | fa9b3ac16b58608f9011778d2c9f508f09dd1601 (patch) | |
tree | db8a3e0f9f5d72f9508b4e73a9ccc68e5fcd3ba1 /helm-info.el | |
parent | ec90fded17e719e7871a8e305b254a4ba3a00f75 (diff) |
Ensure invisible spec in info buffers is inserted (#1503).
* helm-info.el (helm-info-init): Do it.
Diffstat (limited to 'helm-info.el')
-rw-r--r-- | helm-info.el | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/helm-info.el b/helm-info.el index 43c02c8d..ecc8b3ca 100644 --- a/helm-info.el +++ b/helm-info.el @@ -56,18 +56,28 @@ files with `helm-info-at-point'." (save-window-excursion (info file) (let ((tobuf (helm-candidate-buffer 'global)) - (infobuf (current-buffer)) Info-history - start end) + start end line) (cl-dolist (node (Info-index-nodes)) (Info-goto-node node) (goto-char (point-min)) (while (search-forward "\n* " nil t) (unless (search-forward "Menu:\n" (1+ (point-at-eol)) t) (setq start (point-at-bol) - end (point-at-eol)) + ;; Fix issue #1503 by getting the invisible + ;; info displayed on next line in long strings. + ;; e.g "* Foo.\n (line 12)" instead of + ;; "* Foo.(line 12)" + end (or (save-excursion + (goto-char (point-at-bol)) + (re-search-forward "(line +[0-9]+)" nil t)) + (point-at-eol)) + ;; Long string have a new line inserted before the + ;; invisible spec, remove it. + line (replace-regexp-in-string + "\n" "" (buffer-substring start end))) (with-current-buffer tobuf - (insert-buffer-substring infobuf start end) + (insert line) (insert "\n"))))))))) (defun helm-info-goto (node-line) |