Commit graph

10 commits

Author SHA1 Message Date
35e61885a5 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:11:49 +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
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
fabb652b8d fix: ensure results buffer cant go out of bounds 2022-07-29 21:02:40 +01:00
Ade Attwood
39e6878b58 feat: add highlight on matching chars in results buffer 2022-07-23 20:53:07 +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
b82f1af2a1 chore: initial commit 2022-07-10 21:07:33 +01:00