summaryrefslogtreecommitdiff
path: root/helm-regexp.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2015-03-09 07:31:53 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2015-03-09 07:31:53 +0100
commit87a58382d7111f90e28965fde5704c2e244fb25d (patch)
tree19cd2a88238e990b66c21993be4ba33f9ac67c94 /helm-regexp.el
parent182e287dcb08dec1fc94a88124d3e09e5255b3fb (diff)
* helm-regexp.el (helm-moccur-get-line): Add comments, use when.
Diffstat (limited to 'helm-regexp.el')
-rw-r--r--helm-regexp.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/helm-regexp.el b/helm-regexp.el
index a12bf53f..c6bb4950 100644
--- a/helm-regexp.el
+++ b/helm-regexp.el
@@ -213,8 +213,12 @@ i.e Don't replace inside a word, regexp is surrounded with \\bregexp\\b."
'buffer-name)
(point-max)))
(line-number-at-pos beg))
+ ;; When matching empty line, use empty string
+ ;; to allow saving and modifying with wgrep.
(if (= beg end) "" (buffer-substring beg end)))
- (if (= beg end) (forward-char 1))))
+ ;; When matching empty line, forward char ("\n")
+ ;; to not be blocked forever here.
+ (when (= beg end) (forward-char 1))))
(cl-defun helm-moccur-action (candidate
&optional (method (quote buffer)) mark)