Commit graph

102 commits

Author SHA1 Message Date
94dd70fd5a feat: don't search in sapling source control directories
This file should be treated as the .git dir and not show up in the candidates
list for files.
2024-01-15 21:25:44 +00:00
e69668b926 feat: don't require a git directory to use .gitignore files
When we are searching we don't want to have to initialize git repo to use a
.gitignore file. This should just ignore any file in a .gitignore always
2024-01-15 21:25:44 +00:00
renovate[bot]
f48e712a4f fix(deps): update rust crate ignore to 0.4.22 2024-01-08 08:00:54 +00:00
342fb8f301 ci: move away from the unsupported rust actions 2023-12-19 21:07:39 +00:00
2429fe725c perf: move to filter map from map and filter
Instead of doing two passes of all candidates using map then a filter,
this uses `filter_map` so we are only doing one pass for the candidates.
This alone is quite a significant improvement of ~7%

Output of `./scripts/bench 0.x`

Benchmark 1: 0.x
  Time (mean ± σ):      2.373 s ±  0.138 s    [User: 10.617 s, System: 1.697 s]
  Range (min … max):    2.124 s …  2.577 s    10 runs

Benchmark 2: HEAD
  Time (mean ± σ):      2.206 s ±  0.133 s    [User: 10.061 s, System: 1.811 s]
  Range (min … max):    1.940 s …  2.433 s    10 runs

Summary
  HEAD ran
    1.08 ± 0.09 times faster than 0.x

-------------------------------------
The percentage difference is -7.00%
-------------------------------------
2023-12-02 17:27:10 +00:00
renovate[bot]
6a57a15e4b fix(deps): update rust crate ignore to 0.4.21 2023-12-02 16:41:32 +00:00
9f9e4a2023 perf: add lua iteration to decrease loops in lua
Move some of the iteration in to loa and access the values by the index
to reduce the number of loops we need todo to get items into teh results
buffer.

Currently the flow is:
  1) Filter and sort the candidates in rust
  2) Convert to a string and pass to lua
  3) Split the string and add them as lines in a buffer in lua

Now the flow is:
  1) Filter and sort the candidates in rust
  2) Loop over an iterator in lua
  3) Pass each item to lua as a pointer by the index

This removes quite a bit of the work that is needed to get the data into
lua as a table. We are first removing the loop that will join the
results vector into one string. Then we will remove the copy of this
string into lua. We will then finally remove the loop to split the
string and create a table from it in lua. All of this ends up in a 12%
speed up.

Output for `./scripts/bench 0.x`

Benchmark 1: HEAD
  Time (mean ± σ):      2.667 s ±  0.065 s    [User: 8.537 s, System: 1.420 s]
  Range (min … max):    2.588 s …  2.767 s    10 runs

Benchmark 2: 0.x
  Time (mean ± σ):      2.337 s ±  0.150 s    [User: 9.564 s, System: 1.648 s]
  Range (min … max):    2.161 s …  2.529 s    10 runs

Summary
  HEAD ran
    1.14 ± 0.08 times faster than 0.x

-------------------------------------
The percentage difference is -12.00%
-------------------------------------
2023-12-02 16:40:58 +00:00
d707a6e15b chore: add bench script to benchmark two commits
This will quickly benchmark your current commit against a commit you
pass in. This will output the percentage difference so you can quickly
get an idea in the performance changes in your current work
2023-12-01 21:40:54 +00:00
renovate[bot]
421c9b5999 fix(deps): update rust crate rayon to 1.8.0 2023-10-22 17:35:24 +01:00
renovate[bot]
675521cc19 chore(deps): update actions/checkout action to v4 2023-10-22 17:29:20 +01:00
c562190829 refactor: remove lazy_static
once_cell has now been merged into rust core. This removes the
lazy_static dependency and migrates over to the built in `OnceLock`.

Its always good to remove dependencies where possible, this also give us
a preference for the built in `OnceLock`

```
Benchmark 1: chore: add benchmark for `set_items`
  Time (mean ± σ):      6.327 s ±  0.199 s    [User: 15.316 s, System: 1.323 s]
  Range (min … max):    6.087 s …  6.712 s    10 runs

Benchmark 2: refactor: remove lazy_static
  Time (mean ± σ):      6.171 s ±  0.251 s    [User: 15.223 s, System: 1.382 s]
  Range (min … max):    5.910 s …  6.776 s    10 runs

Summary
  'refactor: remove lazy_static' ran
    1.03 ± 0.05 times faster than 'chore: add benchmark for `set_items`'
```
2023-10-22 17:23:28 +01:00
6af2b5011b chore: add benchmark for set_items 2023-10-22 17:23:28 +01:00
renovate[bot]
1c412bffa9 chore(deps): update practically/conventional-tools to 647d6e4 2023-06-25 05:28:35 -07:00
5a0f037b71 feat: add the paste functionality into the ivy prompt
Now when you paste and you are in an ivy buffer the paste will be added
to the prompt not into the completion window. You can use your usual
paste key binding I.E. <SHIFT>+<INSERT> <CTRL>+<SHIFT>+<V>

Ref: #11
2023-06-13 01:19:24 -07:00
0bd6770da4 fix: use package.searchpath to find libivyrs
Now we are useing the package.searchpath to find the libivyrs.so or
libivyrs.dylib. This is so it will load the correct library or the OS
you are on. This fixes the issues with loading the library on macOS.

Ref: #57
2023-06-13 01:19:11 -07:00
renovate[bot]
de7f9a2292 chore(deps): update rust crate criterion to 0.5.1 2023-06-09 09:38:06 -07:00
100723f141 chore: remove dependabot 2023-05-23 09:26:37 +01:00
027819e15f feat: add ripgrep backend
`rg` will now be used over `ag` if it is available. This is because `rg`
is a faster alternative reduces lag when searching larger codebases.
`ag` is also now conditionally loaded if the command is available.
2023-05-23 09:24:36 +01:00
renovate[bot]
92aa2c3433 chore(deps): update johnnymorganz/stylua-action action to v3 2023-05-23 09:23:59 +01:00
56dced41e0 fix: opening terminal buffers
Now when trying to open files and buffers it will use the `buffer`
command when there is an existing buffer with the same name. This will
allow us to open non file buffers like terminals and log buffers.

By using the `bufnr` function to get the existing buffers, it will also
work for buffers that have been renamed with `title` command

Ref: #31
2023-04-26 07:26:12 +01:00
2a72162150 style: run stylua 2023-04-26 07:24:22 +01:00
9017b2c322 perf: return a table of results from the command finder
When reading the output of a command we are now reading the stream line
by line and building the table of results. This will save us a loop of
the results later, if we returned a string we need to split the string
before adding each line to the completion buffer because nvim only
supports replacing one line at a time.
2023-04-26 07:24:22 +01:00
10a3117aae fix: never let a shell command fail
This makes the terminal go really funkie and sometimes crash when
printing the error messages to the current process stdout where nvim is
running.

Now the error output is sent to the `popen` output and displayed in the
ivy completion buffer without messing with the current process io.
2023-04-26 07:24:22 +01:00
ff7c28490d fix: escape \ when running shell commands
This is causing an issue when running shell commands though ivy and
trying to escape chars is in strings or regexes.
2023-04-26 07:24:22 +01:00
149d12e824 ci: move to the dockerhub conventional-tools update 2023-04-18 20:55:07 +01:00
renovate[bot]
4e2c2381ef chore: add renovate.json 2023-03-27 20:48:16 +01:00
dependabot[bot]
e553517f7a chore: bump rayon from 1.6.1 to 1.7.0
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.6.1...rayon-core-v1.7.0)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 16:23:16 +00:00
2032d0748b docs: add section about post-merge compiling 2023-03-03 07:22:08 +00:00
4dd8927ea2 docs: fix the ivy.run example 2023-03-03 07:22:08 +00:00
a69d84dd25 docs: update the API section of the docs 2023-03-03 06:55:46 +00:00
3a21d8e2b0 docs: update IvyFd command description 2023-03-03 06:55:46 +00:00
04d04fc96a docs: add IvyWorkspaceSymbols to the readme 2023-03-03 06:55:46 +00:00
51a72513f4 feat: add IvyWorkspaceSymbol command
This is a command that will search the lsp workspace symbols on a search
term.
2023-03-03 06:55:46 +00:00
45068e759d refactor: introduce backend concept and split out finders / sorters
We now have a concept of a 'backend' this is the same as the current
sorters and finders but with added info like the keymap so they can all
be registered as one. This will allow us to split our backends into
modues so we can better maintain then.
2023-03-03 06:55:46 +00:00
43d7e11c8b fix: unable to open files with $ character in
Ref: #41
2023-02-22 16:42:53 +00:00
dependabot[bot]
0d528d3b1c chore: bump ignore from 0.4.19 to 0.4.20
Bumps [ignore](https://github.com/BurntSushi/ripgrep) from 0.4.19 to 0.4.20.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/commits/ignore-0.4.20)

---
updated-dependencies:
- dependency-name: ignore
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 13:25:44 +00:00
4dace131b8 feat: make delete word in promp work more like bash
Now when you delete a word in a promp it will work more like how it
works in bash. If the text dose not end in a letter then the last word
and all of the tailing special characters will be deleted. If the text
dose end in a letter then only the last word will be deleted leaving the
special characters that are before the last word.

Examples:

| Before             | After       |
| -------------------| ----------- |
| `some word`        | `some `     |
| `some     word`    | `some     ` |
| `some word       ` | `some `     |
2023-01-07 13:49:36 +00:00
dependabot[bot]
877adb42b4 chore: bump ignore from 0.4.18 to 0.4.19
Bumps [ignore](https://github.com/BurntSushi/ripgrep) from 0.4.18 to 0.4.19.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/commits)

---
updated-dependencies:
- dependency-name: ignore
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 14:18:39 +00:00
b57abf3787 feat: remove the cpp implementation
This has not been used in some time and the rust version is way faster

Ref: #28
2022-12-28 15:12:37 +00:00
1af1f0e252 fix: wrap ffi.load in pcall and give a better error message
Now if libivyrs is not found you get a better message that points the
user to the docs on compiling to try and help them resolve the issue.

Ref: #35
2022-12-28 15:01:19 +00:00
3d8d55a146 chore: add issue templates 2022-12-28 11:07:04 +00:00
dependabot[bot]
8b75c9b536 chore: bump rayon from 1.6.0 to 1.6.1
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.6.0...rayon-core-v1.6.1)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 18:05:04 +00:00
f483fc4992 ci: add required version param to stylua-action
This is getting set to latest. The docs say this could break CI due to
changes in stylua bit right now I think that is better than maintain the
version manually.
2022-12-07 20:34:41 +00:00
dependabot[bot]
238d9d184e chore: bump JohnnyMorganz/stylua-action from 1.1.2 to 2.0.0
Bumps [JohnnyMorganz/stylua-action](https://github.com/JohnnyMorganz/stylua-action) from 1.1.2 to 2.0.0.
- [Release notes](https://github.com/JohnnyMorganz/stylua-action/releases)
- [Commits](https://github.com/JohnnyMorganz/stylua-action/compare/v1.1.2...v2.0.0)

---
updated-dependencies:
- dependency-name: JohnnyMorganz/stylua-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-07 20:34:41 +00:00
dependabot[bot]
8635cf81ee chore: bump rayon from 1.5.3 to 1.6.0
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.5.3 to 1.6.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/v1.5.3...rayon-core-v1.6.0)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-07 20:33:34 +00:00
864b9c8821 fix: exscpe test when passing it to vim syntax match
This was causing an issue an invalid regex. Now we are escapeing the
text to make it a valid regex.

There is also a small improvement where we no longer try and highlight
matched words if the "text" is empty.

Ref: #26
2022-10-06 07:57:57 +01:00
1e34a7fe74 test: add more mocks 2022-10-06 07:57:57 +01:00
b255d91e6d test: improve style of the test output
Add more space around the text, also make the text a readable color on
dark backgrounds.
2022-10-06 07:57:57 +01:00
84bf581a31 test: fix the after_each hook not getting called
When writing tests the `after_each` function was never getting called
due to the `before_each` function getting called instead
2022-10-06 07:57:57 +01:00
afbf2892af feat: add logo 2022-10-01 11:11:38 +01:00