aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/linematch.c
Commit message (Collapse)AuthorAge
* vim-patch:9.1.1076: vim_strnchr() is strange and unnecessary (#32327)zeertzjq2025-02-05
| | | | | | | | | | | | | | | | | | | | | | Problem: vim_strnchr() is strange and unnecessary (after v9.1.1009) Solution: Remove vim_strnchr() and use memchr() instead. Also remove a comment referencing an #if that is no longer present. vim_strnchr() is strange in several ways: - It's named like vim_strchr(), but unlike vim_strchr() it doesn't support finding a multibyte char. - Its logic is similar to vim_strbyte(), but unlike vim_strbyte() it uses char instead of char_u. - It takes a pointer as its size argument, which isn't convenient for all its callers. - It allows embedded NULs, unlike other "strn*" functions which stop when encountering a NUL byte. In comparison, memchr() also allows embedded NULs, and it converts bytes in the string to (unsigned char). closes: vim/vim#16579 https://github.com/vim/vim/commit/34e1e8de91ff4a8922d454e3147ea425784aa0a0
* refactor: iwyu #31637Justin M. Keyes2024-12-23
| | | Result of `make iwyu` (after some "fixups").
* fix(coverity/510275): linematch out of bounds access (#30687)Devon Gardner2024-10-07
| | | | | | | | Problem: Int pointer cast to unsigned long pointer causes potential memory corruption. Solution: Cast and store value first, then pass the new pointer.
* fix(diff): use mmfile_t in linematchLewis Russell2024-09-30
| | | | | | | | | | | | | | | Problem: Linematch used to use strchr to navigate a string, however strchr does not supoprt embedded NULs. Solution: Use `mmfile_t` instead of `char *` in linematch and introduce `strnchr()`. Also remove heap allocations from `matching_char_iwhite()` Fixes: #30505
* refactor: replace '\0' with NULJames Tirta Halim2024-06-04
|
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
|
* refactor: iwyu (#26062)zeertzjq2023-11-16
|
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* refactor: the long goodbyedundargoc2023-10-09
| | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
* build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
|
* feat(diff): grouping optimization for linematch algorithmJonathon2023-06-07
|
* fix(linematch): initialize arrayAndreas Schneider2023-04-21
| | | | | | | gsrc/nvim/linematch.c: In function ‘try_possible_paths’: gsrc/nvim/linematch.c:204:35: warning: ‘from_vals’ may be used uninitialized [-Wmaybe-uninitialized] 204 | size_t unwrapped_idx_from = unwrap_indexes(from_vals, diff_len, ndiffs); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* fix(diff): add NULL checkLewis Russell2023-03-06
|
* refactor: fix IWYU mapping file and use IWYU (#21802)dundargoc2023-01-15
| | | Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
* fix(diff): handle long lines without crashing (#21389)Lewis Russell2022-12-12
| | | Fixes https://github.com/neovim/neovim/issues/21388
* Merge pull request #20196 from dundargoc/refactor/char_u/14bfredl2022-11-26
|\ | | | | refactor: replace char_u with char 14: remove `STRLEN` part final
| * refactor: replace char_u with charDundar Göc2022-11-26
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
* | docs: fix typos (#21168)dundargoc2022-11-26
|/
* fix: pvs warnings (#21145)dundargoc2022-11-22
| | | | | | | | | | | * fix(PVS/V009): start file with special comment * fix(PVS/V501): identical sub-expressions for comparison * fix(PVS/V560): part of conditional expression is always true/false * fix(PVS/V593): review expression of type A = B < C * fix(PVS/V614): potentially uninitialized variable used
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* fix(diff): remove size_t underflow (#20929)Lewis Russell2022-11-04
|
* Enable new diff option linematch (#14537)Jonathon2022-11-04
Co-authored-by: Lewis Russell <me@lewisr.dev>