Commit Graph

114 Commits

Author SHA1 Message Date
zeertzjq
0e2f92ed79 build(clint): make NOLINT work with header checks (#31281)
Problem:  NOLINT doesn't work with header checks.
Solution: Move these checks after ProcessLine() calls.
2024-11-20 22:51:58 +08:00
Lewis Russell
c65646c247 fix(diff): use mmfile_t in linematch
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
2024-09-30 11:51:33 +01:00
Justin M. Keyes
737f58e232 refactor(api)!: rename Dictionary => Dict
In the api_info() output:

    :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
    ...

    {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}

The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not (in practice)
a breaking change.
2024-09-23 14:42:57 +02:00
Justin M. Keyes
057d27a9d6 refactor: rename "process" => "proc" #30387
Problem:
- "process" is often used as a verb (`multiqueue_process_events`), which
  is ambiguous for cases where it's used as a topic.
- The documented naming convention for processes is "proc".
  - `:help dev-name-common`
- Shorter is better, when it doesn't harm readability or
  discoverability.

Solution:
Rename "process" => "proc" in all C symbols and module names.
2024-09-15 12:20:58 -07:00
Christian Clason
fa79a8ad6d build(deps): vendor libvterm at v0.3.3
Problem: Adding support for modern Nvim features (reflow, OSC 8, full
utf8/emoji support) requires coupling libvterm to Nvim internals
(e.g., utf8proc).

Solution: Vendor libvterm at v0.3.3.
2024-08-10 10:26:07 +02:00
bfredl
7dffc36e61 refactor(declarations): also generate prototypes for functions in headers
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-07-13 12:30:49 +02:00
bfredl
bbd2f340a2 refactor(memory): use builtin strcat() instead of STRCAT()
The latter was mostly relevant with the past char_u madness.

NOTE: STRCAT also functioned as a counterfeit "NOLINT" for clint
apparently. But NOLINT-ing every usecase is just the same as disabling
the check entirely.
2024-06-11 14:53:52 +02:00
zeertzjq
0ea38c9a53 refactor: add xmemcpyz() and use it in place of some xstrlcpy() (#28422)
Problem:  Using xstrlcpy() when the exact length of the string to be
          copied is known is not ideal because it requires adding 1 to
          the length and an unnecessary strlen().
Solution: Add xmemcpyz() and use it in place of such xstrlcpy() calls.
2024-04-20 19:31:00 +08:00
dundargoc
a74e869ffa docs: small fixes (#27364)
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: Ynda Jas <yndajas@gmail.com>
Co-authored-by: Owen Hines <TheOdd@users.noreply.github.com>
Co-authored-by: Wanten <41904684+WantenMN@users.noreply.github.com>
Co-authored-by: lukasvrenner <118417051+lukasvrenner@users.noreply.github.com>
Co-authored-by: cuinix <915115094@qq.com>
2024-03-12 13:51:53 +08:00
zeertzjq
dcb11c1091 build(clint): don't allow INIT() in non-header files (#27407) 2024-02-10 11:11:30 +08:00
dundargoc
1813661a61 refactor(IWYU): fix headers
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.
2024-01-11 21:37:23 +01:00
dundargoc
675522af18 build: remove clint checks and style text covered by uncrustify 2023-12-24 20:50:44 +01:00
zeertzjq
c16d5729b5 refactor: remove CPO_TO_CPO_FLAGS() (#26718)
Just pass p_cpo to replace_termcodes() directly.
This allows removing option_vars.h from keycodes.h, and also avoids the
mistake of passing 0 as cpo_flags.
2023-12-23 15:53:28 +08:00
zeertzjq
242261d4e7 refactor(IWYU): move evalarg_T to eval_defs.h (#26716) 2023-12-23 08:28:17 +08:00
zeertzjq
089b934352 refactor(options): generate BV_ and WV_ constants (#26705) 2023-12-22 12:24:23 +08:00
dundargoc
af93a74a0f refactor: run IWYU on entire repo
Reference: https://github.com/neovim/neovim/issues/6371.
2023-12-21 17:38:42 +01:00
zeertzjq
8533adb484 refactor(IWYU): move decor provider types to decoration_defs.h (#26692) 2023-12-21 16:50:05 +08:00
zeertzjq
6abdc1ac1f refactor: split WIN_EXECUTE() into two functions (#26627) 2023-12-18 09:05:59 +08:00
zeertzjq
d82a586a9e refactor: move some anonymous enums back to non-defs headers (#26622)
It isn't really useful to put anonymous enums only used as arguments to
functions calls in _defs.h headers, as they will only be used by a file
that calls those functions, which requires including a non-defs header.

Also move os_msg() and os_errmsg() back to message.h, as on Windows they
are actual functions instead of macros.

Also remove gettext.h and globals.h from private/helpers.h.
2023-12-18 06:18:11 +08:00
dundargoc
69bc519b53 refactor: move non-symbols to defs.h headers 2023-12-17 19:03:18 +01:00
dundargoc
1d63a057a6 docs: fix links 2023-12-13 20:31:16 +01:00
zeertzjq
1457272726 refactor(IWYU): move marktree types to marktree_defs.h (#26402) 2023-12-05 20:05:12 +08:00
zeertzjq
0bbe8e7fc2 refactor(IWYU): fix includes for highlight_group.h (#26340) 2023-12-01 09:38:04 +08:00
zeertzjq
09e93d7c4d refactor(IWYU): create {ex_getln,rbuffer,os/fileio}_defs.h (#26338) 2023-12-01 08:06:37 +08:00
zeertzjq
a6f26c86cb refactor(IWYU): fix includes for cmdhist.h (#26324) 2023-11-30 22:48:15 +08:00
zeertzjq
c8e37a589a refactor(IWYU): move typedefs out of globals.h (#26322) 2023-11-30 19:52:23 +08:00
zeertzjq
95dbf1af73 refactor: move extern variables out of _defs.h files (#26320) 2023-11-30 18:41:52 +08:00
zeertzjq
ce56e0a845 refactor(IWYU): move UI and LineFlags to ui_defs.h (#26318) 2023-11-30 17:16:57 +08:00
zeertzjq
86cc791deb refactor: move function macros out of vim_defs.h (#26300) 2023-11-29 23:10:21 +08:00
zeertzjq
a6cba103ce refactor: move some constants out of vim_defs.h (#26298) 2023-11-29 20:32:40 +08:00
zeertzjq
64b53b71ba refactor(IWYU): create normal_defs.h (#26293) 2023-11-29 12:10:42 +08:00
dundargoc
79b6ff28ad refactor: fix headers with IWYU 2023-11-28 22:23:56 +01:00
zeertzjq
71e954ad30 refactor(IWYU): fix includes for ugrid.h (#26267) 2023-11-28 17:01:27 +08:00
zeertzjq
1a8f60c7d2 refactor: move hashtab types to hashtab_defs.h (#26262) 2023-11-28 10:47:22 +08:00
zeertzjq
718053b7a9 refactor: fix runtime_defs.h (#26259) 2023-11-28 07:47:36 +08:00
dundargoc
e3f735ef10 refactor: fix includes for api/autocmd.h 2023-11-27 21:53:07 +01:00
dundargoc
f9231603c4 refactor: fix includes for iconv.h 2023-11-27 21:52:34 +01:00
dundargoc
ab7c0e9904 refactor: create runtime_defs.h 2023-11-27 21:35:21 +01:00
dundargoc
f4aedbae4c build(IWYU): fix includes for undo_defs.h 2023-11-27 19:33:17 +01:00
zeertzjq
38a20dd89f build(IWYU): replace most private mappings with pragmas (#26247) 2023-11-27 20:58:37 +08:00
zeertzjq
574d25642f refactor: move Arena and ArenaMem to memory_defs.h (#26240) 2023-11-27 17:21:58 +08:00
zeertzjq
6343d41436 refactor: move autocmd types to autocmd_defs.h (#26239) 2023-11-27 11:17:04 +08:00
zeertzjq
09541d514d build(IWYU): replace public-to-public mappings with pragmas (#26237) 2023-11-27 09:51:26 +08:00
zeertzjq
7e2387f41b build(clint): more precise check for "defs" headers (#26236) 2023-11-27 08:34:06 +08:00
dundargoc
71141e8cf5 build(IWYU): fix headers for arabic.h 2023-11-26 22:15:53 +01:00
zeertzjq
6361806aa2 refactor: move garray_T to garray_defs.h (#26227) 2023-11-26 22:58:52 +08:00
dundargoc
34509bbea3 build: sync IWYU and clint to ignore the same headers (#26228)
Also fix headers for autocmd.c.
2023-11-26 22:34:29 +08:00
dundargoc
ce6075f82a build: add check to clint to prevent non-defs header includes
Also enable iwyu on headers, but add an ignore for each file separately.

Work on https://github.com/neovim/neovim/issues/6371.
2023-11-26 15:06:51 +01:00
dundargoc
a6e3d93421 refactor: enable formatting for ternaries
This requires removing the "Inner expression should be aligned" rule
from clint as it prevents essentially any formatting regarding ternary
operators.
2023-11-20 19:57:09 +01:00
dundargoc
4f8941c1a5 refactor: replace manual header guards with #pragma once
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-11-12 22:01:28 +01:00