Skip to content

Commit c507c54

Browse files
authored
docs: fix readme (#37)
* docs: fix readme * some ci adjustments
1 parent 66c8705 commit c507c54

File tree

2 files changed

+41
-43
lines changed

2 files changed

+41
-43
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,39 @@ on: [push, pull_request]
44

55
jobs:
66
gcc:
7-
name: gcc
7+
name: c build and tests
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [ubuntu-20.04, macos-10.15]
12-
steps:
13-
- uses: actions/checkout@v2
14-
- name: Prepare
15-
run: |
16-
gcc --version
17-
git clone https://github.com/Conni2461/examiner
18-
cd examiner
19-
make && sudo make install
20-
- name: Build
21-
run: LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib CC=/usr/bin/gcc make
22-
- name: Tests
23-
run: LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib CC=/usr/bin/gcc make test
24-
25-
clang:
26-
name: clang
27-
runs-on: ${{ matrix.os }}
28-
strategy:
29-
matrix:
30-
os: [ubuntu-20.04, macos-10.15]
11+
include:
12+
- os: ubuntu-20.04
13+
compiler: gcc
14+
- os: ubuntu-20.04
15+
compiler: clang
16+
- os: macos-10.15
17+
compiler: gcc
18+
- os: macos-10.15
19+
compiler: clang
3120
steps:
3221
- uses: actions/checkout@v2
3322
- name: Prepare
23+
env:
24+
CC: ${{ matrix.compiler }}
3425
run: |
35-
clang --version
26+
cc --version
3627
git clone https://github.com/Conni2461/examiner
3728
cd examiner
3829
make && sudo make install
3930
- name: Build
40-
run: LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib CC=/usr/bin/clang make
31+
env:
32+
CC: ${{ matrix.compiler }}
33+
LD_LIBRARY_PATH: /usr/lib:/usr/local/lib
34+
run: make
4135
- name: Tests
42-
run: LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib CC=/usr/bin/clang make test
36+
env:
37+
CC: ${{ matrix.compiler }}
38+
LD_LIBRARY_PATH: /usr/lib:/usr/local/lib
39+
run: make test
4340

4441
windows:
4542
name: windows
@@ -66,8 +63,7 @@ jobs:
6663
- name: Restore cache for today's nightly.
6764
uses: actions/cache@v2
6865
with:
69-
path: |
70-
_neovim
66+
path: _neovim
7167
key: ${{ matrix.os }}-${{ hashFiles('todays-date') }}
7268
- name: Prepare
7369
run: |

README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
**fzf-native** is a `c` port of **[fzf][fzf]**. It only covers the algorithm and
44
implements few functions to support calculating the score.
55

6+
This means that the [fzf syntax](https://github.com/junegunn/fzf#search-syntax).
7+
This is an advantage over the more simpler `fzy` algorithm, which is also
8+
available for telescope (as native component or as lua component).
9+
610
## Installation
711

812
To get **fzf-native** working, you need to run make at the root directory. As of
@@ -23,11 +27,13 @@ use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
2327
## Telescope Setup and Configuration:
2428

2529
```lua
30+
-- You dont need to set any of these options. These are the default ones. Only
31+
-- the loading is important
2632
require('telescope').setup {
2733
extensions = {
2834
fzf = {
2935
fuzzy = true, -- false will only do exact matching
30-
override_generic_sorter = false, -- override the generic sorter
36+
override_generic_sorter = true, -- override the generic sorter
3137
override_file_sorter = true, -- override the file sorter
3238
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
3339
-- the default case_mode is "smart_case"
@@ -45,9 +51,6 @@ This section is only addressed towards developers who plan to use the library
4551
(c or lua bindings).
4652
This section is not addressed towards users of the telescope extension.
4753

48-
(**Disclaimer**: Interface is not yet stable. The library is still in
49-
development)
50-
5154
### C Interface
5255

5356
```c
@@ -94,25 +97,24 @@ fzf.free_slab(slab)
9497

9598
## Disclaimer
9699

97-
This project is work in progress and might not be complete compared to
98-
**[fzf][fzf]**. But i think we are at a pretty usable state already.
99-
100-
Another point to mention is that, this will not compare 1:1 with
101-
**[fzf][fzf]**, because telescope handles the sorting, this extension is
102-
only handling the calculation of the score. This means that the order of items
103-
with the same score might be different in telescope compared to **[fzf][fzf]**.
104-
105-
Example for this behaivor is this pattern in this repository: `src | lua`.
106-
All files that match this pattern have the same score which results in a
107-
slightly different order for telescope compared to **[fzf][fzf]**.
100+
This projects implements **[fzf][fzf]** algorithm in c. So there might be
101+
differences in matching. I don't guarantee completeness.
108102

109103
### TODO
110104

111-
Stuff still missing that is present in fzf.
105+
Stuff still missing that is present in **[fzf][fzf]**.
112106

113107
- [ ] normalize
114108
- [ ] case for unicode (i don't think this works currently)
115-
- [ ] and probably more
109+
110+
## Benchmark
111+
112+
Comparison with fzy-native and fzy-lua with a table containing 240201 file
113+
strings. It calculated the score and position (if score > 0) for each of these
114+
strings with the pattern that is listed below:
115+
116+
![benchmark 1](https://raw.githubusercontent.com/wiki/nvim-telescope/telescope.nvim/imgs/bench1.png)
117+
![benchmark 2](https://raw.githubusercontent.com/wiki/nvim-telescope/telescope.nvim/imgs/bench2.png)
116118

117119
## Credit
118120

0 commit comments

Comments
 (0)