emacsorphanage / helm-swoop

Efficiently hopping squeezed lines powered by Emacs helm interface
GNU General Public License v3.0
689 stars 55 forks source link

pre-input escapes special characters #144

Open NightMachinery opened 5 years ago

NightMachinery commented 5 years ago
(add-hook 'Man-mode-hook
            (lambda () (progn
                    (setq helm-swoop-pre-input-function
                          (lambda () (eval "^[0-9]*\\s-*"))))))

image

NightMachinery commented 5 years ago

This might be the offending code, line 225:

(defun helm-swoop-pre-input-optimize ($query)
  (when $query
    (let (($regexp (list '("\+" . "\\\\+")
                         '("\*" . "\\\\*")
                         '("\#" . "\\\\#"))))
      (mapc (lambda ($r)
              (setq $query (replace-regexp-in-string (car $r) (cdr $r) $query)))
            $regexp)
      $query)))
NightMachinery commented 5 years ago

I have nuked this offending function, and everything works for ^[0-9]+\\s-+, but ^[0-9]*\\s-* somehow causes a bug and helm-swoop's buffer doesn't show up at all.

(defun helm-swoop-pre-input-optimize ($query)
    $query) ;; disable swoop escaping
cireu commented 5 years ago

Please elaborate your intention.

Is it a issue or a feature request?

NightMachinery commented 5 years ago

@cireu It's an issue. (The * should not be quoted.) But I'm giving up on it. Feel free to close the issue.

cireu commented 5 years ago

Thanks for your reply, I'll check it.