Skip to content

Commit

Permalink
Make sure rg-literal are reset if the on error and quit
Browse files Browse the repository at this point in the history
  • Loading branch information
dajva committed Nov 21, 2017
1 parent 6041de9 commit 6898409
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions rg.el
Original file line number Diff line number Diff line change
Expand Up @@ -857,14 +857,20 @@ optional DEFAULT parameter is non nil the flag will be enabled by default."
(defun rg-rerun-change-regexp ()
"Rerun last search but prompt for new regexp."
(interactive)
(setq rg-literal nil)
(rg-rerun-change-search-string))
(let ((rg-literal-orig rg-literal))
(setq rg-literal nil)
(condition-case nil
(rg-rerun-change-search-string)
((error quit) (setq rg-literal rg-literal-orig)))))

(defun rg-rerun-change-literal ()
"Rerun last search but prompt for new literal."
(interactive)
(setq rg-literal t)
(rg-rerun-change-search-string))
(let ((rg-literal-orig rg-literal))
(setq rg-literal t)
(condition-case nil
(rg-rerun-change-search-string)
((error quit) (setq rg-literal rg-literal-orig)))))

(defun rg-rerun-change-files()
"Rerun last search but prompt for new files."
Expand Down

0 comments on commit 6898409

Please sign in to comment.