summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/lib
AgeCommit message (Collapse)AuthorFiles
2025-08-14refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guardsbfredl1
These are not needed after #35129 but making uncrustify still play nice with them was a bit tricky. Unfortunately `uncrustify --update-config-with-doc` breaks strings with backslashes. This issue has been reported upstream, and in the meanwhile auto-update on every single run has been disabled.
2024-07-13refactor(declarations): also generate prototypes for functions in headersbfredl1
Before this change, "static inline" functions in headers needed to have their function attributes specified in a completely different way. The prototype had to be duplicated, and REAL_FATTR_ had to be used instead of the public FUNC_ATTR_ names. TODO: need a check that a "header.h.inline.generated.h" file is not forgotten when the first "static inline" function with attributes is added to a header (they would just be silently missing).
2024-01-11refactor(IWYU): fix headersdundargoc1
Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
2023-12-24refactor: follow style guidedundargoc1
2023-12-02refactor: remove unused file ringbuf.hdundargoc1
2023-11-30build: don't define FUNC_ATTR_* as empty in headers (#26317)zeertzjq1
FUNC_ATTR_* should only be used in .c files with generated headers. Defining FUNC_ATTR_* as empty in headers causes misuses of them to be silently ignored. Instead don't define them by default, and only define them as empty after a .c file has included its generated header.
2023-11-12refactor: replace manual header guards with #pragma oncedundargoc2
It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard.
2023-01-13build: remove clint error suppression #21782dundargoc1
Fix remaining clint errors and remove error suppression completely. Rename the lint targets to align with the established naming convention: - lintc-clint lints with clint.py. - lintc-uncrustify lints with uncrustify. - lintc runs both targets. lintc is also provided as a make target for convenience. After this change we can remove these files: https://github.com/neovim/doc/tree/gh-pages/reports/clint https://github.com/neovim/doc/blob/main/ci/clint-errors.sh
2022-09-25refactor: move klib out of src/nvim/ #20341dundargoc4
It's confusing to mix vendored dependencies with neovim source code. A clean separation is simpler to keep track of and simpler to document.
2022-06-20perf(ui): reduce allocation overhead when encoding "redraw" eventsbfredl1
Note for external UIs: Nvim can now emit multiple "redraw" event batches before a final "flush" event is received. To retain existing behavior, clients should make sure to update visible state at an explicit "flush" event, not just the end of a "redraw" batch of event. * Get rid of copy_object() blizzard in the auto-generated ui_event layer * Special case "grid_line" by encoding screen state directly to msgpack events with no intermediate API events. * Get rid of the arcane notion of referring to the screen as the "shell" * Array and Dictionary are kvec_t:s, so define them as such. * Allow kvec_t:s, such as Arrays and Dictionaries, to be allocated with a predetermined size within an arena. * Eliminate redundant capacity checking when filling such kvec_t:s with values.
2022-05-25refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc5
2022-05-14refactor(api/nvim_cmd): use `kvec_t` for constructing cmdline stringFamiu Haque1
Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2022-05-06refactor: upgrade uncrustify configuration to version 0.75Dundar Goc1
2022-04-29refactor(uncrustify): change rules to better align with the style guideDundar Goc1
Add space around arithmetic operators '+' and '-'. Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('. Remove space between '((' or '))' of control statements. Add space between ')' and '{' of control statements. Remove space between function name and '(' on function declaration. Collapse empty blocks between '{' and '}'. Remove newline at the end of the file. Remove newline between 'enum' and '{'. Remove newline between '}' and ')' in a function invocation. Remove newline between '}' and 'while' of 'do' statement.
2021-11-27chore: fix typos (#16361)dundargoc1
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: István Donkó <istvan.donko@gmail.com> Co-authored-by: Julian Berman <Julian@GrayVines.com> Co-authored-by: bryant <bryant@users.noreply.github.com> Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com> Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com> Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com> Co-authored-by: Jesse Wertheim <jaawerth@gmail.com> Co-authored-by: dm1try <me@dmitry.it> Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl> Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com> Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: István Donkó <istvan.donko@gmail.com> Co-authored-by: Julian Berman <Julian@GrayVines.com> Co-authored-by: bryant <bryant@users.noreply.github.com> Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com> Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com> Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com> Co-authored-by: Jesse Wertheim <jaawerth@gmail.com> Co-authored-by: dm1try <me@dmitry.it> Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl> Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
2021-11-19refactor: saner options for uncrustify (#16204)dundargoc2
* sp_enum_after_assign = force * sp_brace_typedef = force * nl_do_brace = remove * sp_do_brace_open = force * sp_brace_close_while = force * sp_before_semi = remove * sp_before_semi_for = remove * sp_before_semi_for_empty = remove * sp_between_semi_for_empty = remove * sp_after_semi_for_empty = remove * sp_before_square = remove * sp_before_squares = remove * sp_inside_square = remove * sp_inside_fparens = remove * sp_inside_fparen = remove * sp_inside_tparen = remove * sp_after_tparen_close = remove * sp_return_paren = force * pos_bool = lead * sp_pp_concat = remove * sp_pp_stringify = remove * fixup: disable formatting for the INIT section
2021-10-31refactor: saner options for uncrustify #16196dundargoc2
* refactor: general good option changes sp_deref = remove sp_not = remove sp_inv = remove sp_inside_paren_cast = remove mod_remove_duplicate_include = true sp_after_semi = add sp_after_semi_for = force sp_sizeof_paren = remove nl_return_expr = remove nl_else_brace = remove nl_else_if = remove * refactor: mod_remove_extra_semicolon = true * refactor: nl_max = 3 * refactor: sp_bool = force * refactor: sp_compare = force * refactor: sp_inside_paren = remove * refactor: sp_paren_paren = remove * refactor: sp_inside_sparen = remove * refactor: sp_before_sparen = force * refactor: sp_sign = remove * refactor: sp_addr = remove * refactor: sp_member = remove * refactor: nl_struct_brace = remove * refactor: nl_before_if_closing_paren = remove * refactor: nl_fdef_brace = force * refactor: sp_paren_comma = force * refactor: mod_full_brace_do = add
2021-10-29refactor: uncrustify #16090dundargoc3
2021-10-23feat(decorations): support more than one virt_lines blockBjörn Linse1
2021-10-19refactor: enable formatting for files under libDundar Göc6
2021-10-12refactor: format all C files under nvim/ #15977dundargoc6
* refactor: format all C files under nvim * refactor: disable formatting for Vim-owned files: * src/nvim/indent_c.c * src/nvim/regexp.c * src/nvim/regexp_nfa.c * src/nvim/testdir/samples/memfile_test.c
2021-03-30Change QUEUE_FOREACH macro to use while instead of forerw71
2019-11-11nsmarks: initial committimeyyy1
2019-05-25kvec.h: kv_destroy: reinitialize after freeJustin M. Keyes1
2019-05-25refactor: introduce XFREE_CLEAR()Justin M. Keyes5
Unfortunately we cannot indiscriminately replace xfree() with XFREE_CLEAR(), because comparing pointers after freeing them is a common pattern. Example in `tv_list_remove_items()`: xfree(li); if (li == item2) { break; } Instead we can do it selectively/explicitly. ref #1375
2019-05-18kbtree.h: assert valid range #10022Justin M. Keyes1
ref #10012
2019-05-18kbtree: pointer UB and unitialized value fixesBjörn Linse1
- don't underflow itr->p pointer (C standard only allows one past the end, not one before the beginning) - make sure itr->p->i is always initialized (even when not used) - don't rely on `NULL < &object` (likely UB)
2019-02-27os/env: use libuv v1.12 getenv/setenv APIJustin M. Keyes1
- Minimum required libuv is now v1.12 - Because `uv_os_getenv` requires allocating, we must manage a map (`envmap` in `env.c`) to maintain the old behavior of `os_getenv` . - free() map-items after removal. khash.h does not make copies of anything, so even its keys must be memory-managed by the caller. closes #8398 closes #9267
2018-07-21ui: use line-based rather than char-based updates in screen.cBjörn Linse1
Add ext_newgrid and ext_hlstate extensions. These use predefined highlights and line-segment based updates, for efficiency and simplicity.. The ext_hlstate extension in addition allows semantic identification of builtin and syntax highlights. Reimplement the old char-based updates in the remote UI layer, for compatibility. For the moment, this is still the default. The bulitin TUI uses the new line-based protocol. cmdline uses curwin cursor position when ext_cmdline is active.
2018-04-15kvec: Silence PVS/V512: it is not needed to fill the whole arrayZyX1
2018-02-28build/msvc: Fix missing restrict keywordb-r-o-c-k1
MSVC has the __restrict keyword and a marco is defined for it in `win_defs.h`.
2018-02-19build/gcc: disable -Warray-bounds entirely #7923Justin M. Keyes1
We need to disable -Warray-bounds locally for kbtree.h, but we can't because _Pragma("GCC diagnostic pop") is broken in GCC 5.x+. So this commit disables -Warray-bounds entirely (for GCC only). GCC bug: "_Pragma diagnostic 'ignored' in macro with strict-overflow not suppressing warning fully with -Werror" https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66099 ref https://github.com/neovim/neovim/pull/7083#issuecomment-326323599 closes #7921
2017-10-08klee: Start preparing for klee testsZyX1
First stage: something compiling without klee, but with a buch of dirty hacks - done. Second stage: something running under klee, able to emit useful results, but still using dirty hacks - done. Third stage: make CMake care about clang argumnets - not done, may be omitted if proves to be too hard. Not that klee can be run on CI in any case.
2017-10-08kvec: Add kv_Z which is like kv_A, but zero is the last valueZyX1
2017-09-29kvec: Add kv_drop() which is to be used like `(void)kv_pop(kvec)`ZyX1
2017-06-24bufhl: fix moveBjörn Linse1
2017-06-24kbtree: make warning free and delete deprecated macrosBjörn Linse1
2017-06-24kbtree: eliminate unneccesary heap allocationBjörn Linse1
2017-06-24kbtree: use proper structsBjörn Linse1
2017-06-24kbtree: allow iterators to start at arbitrary positionBjörn Linse1
2017-06-24kbtree.htimeyyy1
2016-12-09tui: "backpressure": Drop messages to avoid flooding.Justin M. Keyes1
Closes #1234 multiqueue: - Implement multiqueue_size() - Rename MultiQueueItem.parent to MultiQueueItem.parent_item, to avoid confusion with MultiQueue.parent.
2016-06-24kvec: Do not bother with making capacity a power of 2ZyX1
This avoids gcc warnings about undefined behaviour.
2016-06-11*: Also fix the adjacent errorsZyX1
2016-06-11*: Fix errors from new linter checksZyX3
2016-05-30kvec,typval_encode: Add new vector: the one with preallocated arrayZyX1
2016-05-30Merge pull request #4843 from ZyX-I/refactor-queueJustin M. Keyes1
lib/queue: Refactor queue.h
2016-05-30lib/queue: Actually remove all _QUEUE macrosZyX1
2016-05-30lib/queue: Refactor queue.hZyX1
Changes: 1. Linter finds no errors now. 2. Most of macros changed to `static inline … FUNC_ATTR_ALWAYS_INLINE` functions (that was the purpose: they are easier to debug). 3. Queue is now not a pair of void* pointers, but a struct with two QUEUE pointers, next and prev. This should not affect anything, except that _QUEUE private macros can really be avoided without reducing readability and they do not need any casts.
2016-05-30lib/kvec: Fix remaining linter errorsZyX1