diff options
| author | Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de> | 2012-11-12 09:24:44 +0100 |
|---|---|---|
| committer | Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de> | 2012-11-12 09:24:44 +0100 |
| commit | e62e6a192f443faae65edcc9a12d86f779b68a7c (patch) | |
| tree | b7b8246b6f1a69da6fb2e5226d778b7e02c3bea5 | |
| parent | bd0e7f13a008a56aa16db3b0f842336dadc2d52b (diff) | |
Fix usage of `evil-ex-range' in substitution code.
The ex-range can be an arbitrary range. The using code must not make
any assumption on the type of the range or its expansion state.
| -rw-r--r-- | evil-search.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/evil-search.el b/evil-search.el index 3ea1cef..dc81d9f 100644 --- a/evil-search.el +++ b/evil-search.el @@ -1012,13 +1012,17 @@ This handler highlights the pattern of the current substitution." (condition-case lossage (let* ((result (evil-ex-get-substitute-info arg)) (pattern (pop result)) - (replacement (pop result))) + (replacement (pop result)) + (range (or (evil-copy-range evil-ex-range) + (evil-range (line-beginning-position) + (line-end-position) + 'line + :expaned t)))) (setq evil-ex-substitute-current-replacement replacement) - (apply #'evil-ex-hl-set-region - 'evil-ex-substitute - (or evil-ex-range - (evil-range (line-beginning-position) - (line-end-position)))) + (evil-expand-range range) + (evil-ex-hl-set-region 'evil-ex-substitute + (evil-range-beginning range) + (evil-range-end range)) (evil-ex-hl-change 'evil-ex-substitute pattern)) (end-of-file (evil-ex-pattern-update-ex-info nil |
