fdschmidt93 / telescope-egrepify.nvim

Variable user customization for telescope.live_grep to set rg flags on-the-fly
MIT License
122 stars 13 forks source link

Support multiple boolean flags under one prefix #28

Open pr4th4m opened 11 months ago

pr4th4m commented 11 months ago

This PR adds support multiple boolean flags for one prefix

["."] = {
    flag = "hidden no-ignore ignore-case",
},

This is a hacky way to add support for multiple boolean flags, if you come up with a better option we can collab or if you feel this isn't the way forward we can close this PR

pr4th4m commented 10 months ago

Nevertheless, shouldn't flag then better be a string or table of strings? Strikes me as cleaner than whitespace-separated flags.

Good point, however, flag will have two datatypes string and table as its been used for boolean flags as well as regular (key/value) flags. I feel this might confuse user as the data type of flag will not be consistent across boolean and regular flags. Ofcourse, we can address this in documentation but at first glance it might be confusing, your thoughts ?

ex -

  ["."] = {
       flag = {"hidden", "no-ignore", "ignore-case"}  // table allowed here
   },
  ["&"] = {
      flag = "glob", // table not allowed here
      cb = function(input)
          return string.format([[*{%s}*]], input)
      end,
  }

Will update documentation as per the call we take on above discussion.

pr4th4m commented 10 months ago

@fdschmidt93 thoughts on above?