Commit graph

34 commits

Author SHA1 Message Date
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
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
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
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
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
e9cdd40c74 fix: crash in IvyLines 2022-09-18 19:58:09 +01:00
6f58ad6d67 feat: add vsplit and split actions
Now you can open the currently selected item in a vertical split or a
horizontal split. The completion callback must support the current
actions.

There is also a bit of testing in here. The vim mock has been refactored
and split out so we can use it multiple tests.
2022-09-07 21:19:33 +01:00
ced6e5ae1e ci: setup stylua action 2022-09-04 16:18:04 +01:00
95be579cef fix: ensure the correct window is activated on complete
When you complete a completion the completion window is no longer
activated after the callback is run. This was causing issues with the
incorrect window being active after the completion.

This will lead the way for more actions other then edit, that will be
comming soon.

Fixes-issue: #8
2022-09-04 15:34:47 +01:00
a3cd30d4ff test: add base test for ivy.window 2022-09-04 15:34:47 +01:00
3b0d1510e7 fix: include dot files in search results
This adds dot files into the finder. We are adding the overrides to the
`ignore` package, that can be used later to add custom ignore
directories that can be passed in as settings.

We are also adding a new `ivy_cwd` function to libivy to get the current
directory due to the limitations of lua.

Fixes-issue: #16
2022-09-04 13:33:50 +01:00
252fc9da1d fix: displaying the incorrect number of items in completions 2022-09-02 21:33:19 +01:00
a712c929cb feat: make the completion candidates type more consistent
The API for `window.set_items` took to many variable types. It would
take a table in multiple different formats and a string. Now it will
only take a table in a single format and a string. It will convert the
string into the table format by splitting it on new lines.

The table format is an array of tables that must have a `content` key
that will be the text that is displayed in the completion window. The
table can have any other data that is ignored.

```lua
local items = {
  { content = "Item one" },
  { content = "Item two" }
}
```

The `set_items` function will only display the `content` key in the
completion window, it will not do any sorting or filtering, that must be
done before passing the data to the `set_items` function.
2022-09-02 21:03:56 +01:00
e7b7dc1e4c feat: experimental first rust implementation of libivy 2022-08-25 20:19:01 +01:00
7439ff98b0 feat: move to fts fuzzy match with some modifications 2022-08-25 20:14:12 +01:00
Ade Attwood
f2a22c2190 test: add test for ivy.prompt 2022-08-06 14:21:36 +01:00
Ade Attwood
617f6a98cc test: a test script and some tests
This adds the start of the test suite that we can add into CI to ensure
we are not pussing a broken build.
2022-08-06 10:45:04 +01:00
fabb652b8d fix: ensure results buffer cant go out of bounds 2022-07-29 21:02:40 +01:00
Ade Attwood
c9ce8ac4d1 feat: implement emacs bindings for the prompt like bash
Now the prompt will act like the default bash readline with emacs key
bindings, clear and delete word.

You can now also move left and right in the prompt to insert chars in
the middle of the prompt rather than having to delete your search term
and start again.
2022-07-24 12:50:30 +01:00
Ade Attwood
39e6878b58 feat: add highlight on matching chars in results buffer 2022-07-23 20:53:07 +01:00
Ade Attwood
9b3d186701 feat: implement IvyLines to search the lines in the current buffer 2022-07-23 20:30:14 +01:00
Ade Attwood
7577706545 refactor: implement the origin api
This will allow you to get the buffer the user was on when they invoked
an ivy command. This buffer is called the `origin` and you can access it
with `vim.ivy.origin()`.
2022-07-23 20:17:31 +01:00
Ade Attwood
75d1c0d171 feat: add window title for each of the actions 2022-07-23 20:14:52 +01:00
Ade Attwood
8ac1035d8a feat: add loading text for large projects
Large projects can take a long time for the initial scan. This adds some
loading text until the initial selection has completed.

This will also now schedule the work to collect and sort the candidates
to ensure the UI is rendered before with work begins and creates a
hanging user experience.
2022-07-23 14:59:51 +01:00
Ade Attwood
3f6149d3e1 feat: add initial implementation of cpp file finder
This uses lua ffi and a cpp shard library to implement a file finder in
cpp so we can use threads more effectively and get better performance.
2022-07-23 08:49:45 +01:00
Ade Attwood
b82f1af2a1 chore: initial commit 2022-07-10 21:07:33 +01:00