armindarvish / consult-omni

A Powerful Versatile Omni Search inside Emacs
https://github.com/armindarvish/consult-omni/tree/main
165 stars 4 forks source link

Cannot use consult--source-recent-file #27

Closed jyp closed 2 months ago

jyp commented 2 months ago

Describe the bug Using consult--source-recent-file as a source yields no result, and fails if a specific input is confirmed with I get the error Args out of range: [], 0

To Reproduce For instance, evaluate:

(consult-omni-multi ".profile" "test prompt" '(consult--source-recent-file)) and to confirm

Expected behavior I'm expecting to see a list of recent files whose name contain ".profile" (and be able to choose among them), then the selection should be open upon pressing

Important Information:

(require 'consult-omni)
(require 'consult-omni-sources)
(require 'consult-omni-buffer)

Additional context

The buffer source fails in the same way:

(consult-omni-multi "*scratch*" "test prompt" '(consult-omni--source-buffer))

nix package definition:

    consult-omni = let
      pname = "consult-omni";
      files = ''(:defaults "sources/*.el")'';
      # commit = "56939bc67b35246b355033251086d06682ae53cd"; # tag v0.1
      commit = "7f39e3a599348ad21cb3c36110f7ebd85c212ec2";  # <2024-09-01 Sun>
    in emSelf.melpaBuild {
      inherit commit;
      inherit pname;
      version = "0.1";
      packageRequires = with emSelf; [ consult ];
      recipe = pkgs.writeText "${pname}-recipe" ''
          (${pname}
            :repo "armindarvish/consult-omni"
            :fetcher github
            :files ${files})
      '';

      passthru.updateScript = pkgs.unstableGitUpdater { };

      src = pkgs.fetchFromGitHub {
        owner = "armindarvish";
        repo = "consult-omni";
        rev = commit;
        hash = "sha256-+IJWFgSeb3Kh7F/GG6PX+jQCn7v97QZWE485hCmj37E=";
      };

      meta = {
        description = "A powerful versatile omni search";
        license = lib.licenses.bsd3;
      };
    };
armindarvish commented 2 months ago

@jyp just pushed a fix to develop. Test it now and let me know if it is resolved.

jyp commented 2 months ago

Works great. Thanks for the quick bugfix!