Skip to content

Error with config #1738

Answered by ibhagwan
rieje asked this question in Q&A
Jan 21, 2025 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

after some refactoring

Now this makes sense, rg_glob_fn is sent to the external process using bytecode, as such it cannot use external functions local to your file only you need to move the rebuild_regex function inside

require("fzf-lua").live_grep({
  rg_glob = true,
  glob_separator = "",
  rg_glob_fn = function(query)
    ---@param str string
    ---@return string
    local function rebuild_regex(str)
      local result = str:gsub("%s+", function(r)
        if #r == 1 then
          return ".*"
        else
          return r:match("%s(.*)")
        end
      end)
      return result
    end
    local regex, flags = query:match("^(.-)%s%-%-(.*)$") ---@type string|nil, string|nil
    if 

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rieje
Comment options

@ibhagwan
Comment options

@rieje
Comment options

@ibhagwan
Comment options

Answer selected by rieje
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants