Commit Graph

8 Commits

Author SHA1 Message Date
JINNOUCHI Yasushi
87ccbae5d2
feat: call init process before telescope loading (#234)
* feat: call init process before telescope loading

Fix #231

This changes enable to load frecency without telescope's loading itself.
This is needed when you want to load telescope lazily, but want to start
registering process as soon as Neovim has started.

```lua
{
  "nvim-telescope/telescope-frecency.nvim",
  main = "frecency",
  ---@type FrecencyOpts
  opts = {
    db_safe_mode = false,
  },
},

{
  "nvim-telescope/telescope.nvim",
  -- `cmd` opts makes lazy.nvim load telescope.nvim lazily.
  cmd = { "Telescope" },
  config = function()
    local telescope = require "telescope"
    telescope.setup {
      extensions = {
        other_extension = {
          foo_bar = true,
        },
        -- Here you need no configuration opts for frecency because
        -- you've already done.
      }
    }
    -- This is still needed.
    telescope.load_extension "frecency"
  end,
},
```

* docs: add note for loading telescope.nvim lazily
2024-08-01 17:12:43 +09:00
JINNOUCHI Yasushi
be5add7248
feat: add an option for a function to ignore files (#223)
* refactor: use vim.pesc instead of implementing

* feat: add optional func to ignore in registering

* test: add tests for ignore_register function

* docs: add note for `ignore_register` option

* docs: add note for use case of `ignore_patterns`
2024-07-14 23:11:14 +09:00
JINNOUCHI Yasushi
880e89eadb
fix: delay setup not to avoid bg color detection (#213)
Fix #210
2024-07-13 23:21:01 +09:00
JINNOUCHI Yasushi
a03eb9b78a
fix!: show debug msg only when debug is true (#220)
* docs: fix the format for some docs

* fix!: show debug msg only when `debug` is `true`

Fix #212

* test: enable debug logging in tests
2024-07-06 19:13:39 +09:00
JINNOUCHI Yasushi
8f593064f7
feat: add frecency.query() to query DB (#217)
* feat: add function to query the DB

* docs: add documentation for frecency.query()

* test: fix tests to run with `timestamps` property

* test: add tests for frecency.query()
2024-07-06 15:35:59 +09:00
JINNOUCHI Yasushi
2a22815b09
Simplify code with using frecency.config (#189)
* chore: change the position of `?`

* fix: use config module to simplify code

* test: fix tests to use frecency.config

* test: remove macOS with nightly Neovim temporarily
2024-03-25 18:45:45 +09:00
JINNOUCHI Yasushi
bd52772bf2
fix!: change timing for initialization (#179)
* fix!: change timing for initialization

fix #109
fix #59

This fixes problems below.

* Auto-validation feature is called at Neovim starting.
   - → Now it starts at `:Telescope frecency` called at the first time.
* `frecency.setup()` is called every when `:Telescope frecency` is
  called.
   - → Now it is called only once.
* `telescope.setup()` calls `frecency.new()` and it reads the database.
  This causes time in executing `init.lua`.
   - → Now it reads the database lazily. It reads at the first time when
     needed.

* test: change logic to initialize config

* test: make Neovim version newer in CI
2024-03-14 20:28:06 +09:00
JINNOUCHI Yasushi
1f32091e2b
refactor!: use OO & add tests (#100)
* I did an overhall for all codes and added typing by Lua-language-server and tests. It also works on CI.
* Now it searches files on the workspace completely asynchronously. It does not block your text input. (Fix #106)
Make count = 1 when you open a file you've never opened (Fix #107)
2023-08-06 16:02:37 +09:00