Skip to content

Commit

Permalink
Integrate evil with ctrlf-style-alist. (#124)
Browse files Browse the repository at this point in the history
* Integrate evil with ctrlf-style-alist.

* Update changelog

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
  • Loading branch information
Alexander-Miller and raxod502 authored Sep 11, 2022
1 parent 63d27a0 commit e4bd61e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog].

## Unreleased
### Enhancements
* Improved evil-mode's search history integration so it will now use
the translations defined in `ctrlf-style-alist` ([#124]).

### Bugs fixed
* Previously `C-g` would fail to reset point to its original position
in some cases. This has been fixed ([#110], [#114]).

[#110]: https://github.com/radian-software/ctrlf/issues/110
[#114]: https://github.com/radian-software/ctrlf/pull/114
[#124]: https://github.com/radian-software/ctrlf/pull/124

## 1.5 (released 2022-06-01)
### Features
Expand Down
11 changes: 7 additions & 4 deletions ctrlf.el
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,13 @@ Will add search pattern STR to evil's search history ring."
(setq isearch-string str))
(evil-search
(add-to-history 'evil-ex-search-history str)
(setq evil-ex-search-pattern (list str nil t))
(setq evil-ex-search-direction 'forward)
(when evil-ex-search-persistent-highlight
(evil-ex-search-activate-highlight evil-ex-search-pattern))))))
(let* ((style-plist (alist-get ctrlf--style ctrlf-style-alist))
(translator (plist-get style-plist :translator))
(translated-str (funcall translator str)))
(setq evil-ex-search-direction 'forward
evil-ex-search-pattern (list translated-str nil t))
(when evil-ex-search-persistent-highlight
(evil-ex-search-activate-highlight evil-ex-search-pattern)))))))
str)

;;;; Main loop
Expand Down

0 comments on commit e4bd61e

Please sign in to comment.