aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lib
Commit message (Collapse)AuthorAge
* refactor(declarations): also generate prototypes for functions in headersbfredl2024-07-13
| | | | | | | | | | | 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).
* refactor(IWYU): fix headersdundargoc2024-01-11
| | | | | | 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.
* refactor: follow style guidedundargoc2023-12-24
|
* refactor: remove unused file ringbuf.hdundargoc2023-12-02
|
* build: don't define FUNC_ATTR_* as empty in headers (#26317)zeertzjq2023-11-30
| | | | | | 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.
* refactor: replace manual header guards with #pragma oncedundargoc2023-11-12
| | | | | 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.
* build: remove clint error suppression #21782dundargoc2023-01-13
| | | | | | | | | | | | | | | 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
* refactor: move klib out of src/nvim/ #20341dundargoc2022-09-25
| | | | It's confusing to mix vendored dependencies with neovim source code. A clean separation is simpler to keep track of and simpler to document.
* perf(ui): reduce allocation overhead when encoding "redraw" eventsbfredl2022-06-20
| | | | | | | | | | | | | | | | | 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.
* refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc2022-05-25
|
* refactor(api/nvim_cmd): use `kvec_t` for constructing cmdline stringFamiu Haque2022-05-14
| | | | Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
* refactor: upgrade uncrustify configuration to version 0.75Dundar Goc2022-05-06
|
* refactor(uncrustify): change rules to better align with the style guideDundar Goc2022-04-29
| | | | | | | | | | | | | 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.
* chore: fix typos (#16361)dundargoc2021-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* refactor: saner options for uncrustify (#16204)dundargoc2021-11-19
| | | | | | | | | | | | | | | | | | | | | | | | * 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
* refactor: saner options for uncrustify #16196dundargoc2021-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* refactor: uncrustify #16090dundargoc2021-10-29
|
* feat(decorations): support more than one virt_lines blockBjörn Linse2021-10-23
|
* refactor: enable formatting for files under libDundar Göc2021-10-19
|
* refactor: format all C files under nvim/ #15977dundargoc2021-10-12
| | | | | | | | * 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
* Change QUEUE_FOREACH macro to use while instead of forerw72021-03-30
|
* nsmarks: initial committimeyyy2019-11-11
|
* kvec.h: kv_destroy: reinitialize after freeJustin M. Keyes2019-05-25
|
* refactor: introduce XFREE_CLEAR()Justin M. Keyes2019-05-25
| | | | | | | | | | | | | | | 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
* kbtree.h: assert valid range #10022Justin M. Keyes2019-05-18
| | | ref #10012
* kbtree: pointer UB and unitialized value fixesBjörn Linse2019-05-18
| | | | | | | - 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)
* os/env: use libuv v1.12 getenv/setenv APIJustin M. Keyes2019-02-27
| | | | | | | | | | | - 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
* ui: use line-based rather than char-based updates in screen.cBjörn Linse2018-07-21
| | | | | | | | | | | | | 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.
* kvec: Silence PVS/V512: it is not needed to fill the whole arrayZyX2018-04-15
|
* build/msvc: Fix missing restrict keywordb-r-o-c-k2018-02-28
| | | | MSVC has the __restrict keyword and a marco is defined for it in `win_defs.h`.
* build/gcc: disable -Warray-bounds entirely #7923Justin M. Keyes2018-02-19
| | | | | | | | | | | | | | | 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
* klee: Start preparing for klee testsZyX2017-10-08
| | | | | | | | | | | 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.
* kvec: Add kv_Z which is like kv_A, but zero is the last valueZyX2017-10-08
|
* kvec: Add kv_drop() which is to be used like `(void)kv_pop(kvec)`ZyX2017-09-29
|
* bufhl: fix moveBjörn Linse2017-06-24
|
* kbtree: make warning free and delete deprecated macrosBjörn Linse2017-06-24
|
* kbtree: eliminate unneccesary heap allocationBjörn Linse2017-06-24
|
* kbtree: use proper structsBjörn Linse2017-06-24
|
* kbtree: allow iterators to start at arbitrary positionBjörn Linse2017-06-24
|
* kbtree.htimeyyy2017-06-24
|
* tui: "backpressure": Drop messages to avoid flooding.Justin M. Keyes2016-12-09
| | | | | | | | | Closes #1234 multiqueue: - Implement multiqueue_size() - Rename MultiQueueItem.parent to MultiQueueItem.parent_item, to avoid confusion with MultiQueue.parent.
* kvec: Do not bother with making capacity a power of 2ZyX2016-06-24
| | | This avoids gcc warnings about undefined behaviour.
* *: Also fix the adjacent errorsZyX2016-06-11
|
* *: Fix errors from new linter checksZyX2016-06-11
|
* kvec,typval_encode: Add new vector: the one with preallocated arrayZyX2016-05-30
|
* Merge pull request #4843 from ZyX-I/refactor-queueJustin M. Keyes2016-05-30
|\ | | | | lib/queue: Refactor queue.h
| * lib/queue: Actually remove all _QUEUE macrosZyX2016-05-30
| |
| * lib/queue: Refactor queue.hZyX2016-05-30
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | lib/kvec: Fix remaining linter errorsZyX2016-05-30
| |
* | lib/kvec: Make code cleanerZyX2016-05-30
| |