Recent versions of cmake seem to affect how redundant installation
directives are handled, i.e. install source and destination are the
same. While previously they went through as a noop, they now seem
to fail as reproduced in #120.
This change brings in several things
1. The `CMakeLists.txt` file has been reorganized and brought up to more
"modern" CMake code (while still working with CMake 3.2 at a minimum)
2. A fix has been added for #77, to always set the suffix to `.dll`,
regardless of toolchain
3. Warnings for _CRT_SECURE and _CRT_NONSTDC are now disabled.
4. This also adds the most minimal version of a cmake "preset" for CMake
3.19 and later. This adds generators for unix makefiles and ninja,
allowing users to simply execute their post-install step as:
```console
$ cmake --preset <ninja|make>
$ cmake --build build --target install
```
replacing with_pos
Leads to:
- more readable code
- less allocations
Breaks:
- fzf_get_positions can now return NULL if there isnt a match and
pattern is longer > 0 none whitespace bytes
This stuff has breaking changes in the c interface. And i most likely will change more things in the future. But in the end it should lead to a better result.
Take a look at the header for a detailed overview of the changes. Should be straight forward to adapt
breaking changes for c ABI. unrelated for lua users.
- `get_positions` can now return NULL for an empty pattern input
- `get_score` will now return 1 for an empty pattern input. previously handled in the telescope lua part of the code. Now its moved to c
Compiling with cygwin (gcc 10.2.0) on win10 fails because of "array
subscript has type 'char'" warnings. If isspace is called with a
negative char value it would invoke undefined behavior.
* Test and fix the algorithm
The tests were ported from the go version. And when running them a
couple of issues were found and fixed.
* Fix position checks
The tests that were testing for returned positions did not check the
whole array. This fixes that, and also verifies that the length matches.
* Fix lua test
The correct score is 54
16 + 2 * 8 - 3 - 2 * 1 + 16 - 3 - 2 * 1 + 16 = 54
Windows users should do a `make clean && make` to cleanup previous things.
A dll file will be build and loaded on windows now (no longer a so file).
I hope that fixes most platform / build system related issues
This includes a lot of things:
- Making types more consistent
- Fixes for get_positions
- Small performance improvement for telescope lua
This will help with further development:
- More c integration tests
- lua tests to validate the bindings
- Small benchmark for c library
Also it turns out that the c library is around 25% faster, tested with the benchmark. (no idea why)