Skip to content

Bug fixes and enhancement #5

Open

Description

@deb75

Hi,

First, thanks for this nice package.

I had troubles using it at the beginning on windows11/mingw64/emacs29.0.60.

Here are a few modifications I made to make it work :

(defun helm-lines-search-rg (query root)
  "Search for lines matching QUERY in ROOT folder with `rg'."
  ;; https://jdhao.github.io/2020/02/16/ripgrep_cheat_sheet/
  (format (concat "rg"
                  " %s %s"
                  " --fixed-strings"
                  " --no-line-number"
                  " --no-filename"
                  " -g '!.git'"
                  " -g '!target'"
                  " -g '!node_modules'")
          query root))


(defun helm-lines-search-ag (query root)
  "Search for lines matching QUERY in ROOT folder with `ag'."
  (format (concat "ag"
                  " --literal"
                  " --nocolor"
                  " --nonumbers"
                  " --nofilename"
                  " --ignore .git"
                  " --ignore target"
                  " --ignore node_modules"
                  " %s %s")
          query root))

The main difference is that I replaced \"%s\" %s into %s %s because here :

         (cmd (concat (funcall helm-lines-search-function
                               (shell-quote-argument query)
                               (shell-quote-argument root))

you already quote arguments. This was breaking the search engine when a space appear in the query.

The other difference is that I made both engines search for literal strings, not regexp.

I guess this hard coded change could easily be made customizable.

Regards

Activity

  1. torgeir commented on Jan 27, 2023

    @torgeir
    Owner

    Hey!

    And thanks for taking the time to fix it. Do care to have a go at making it customizable? I don’t use this package myself any longer, as I switched to vertico, but I’d be happy to accept PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions