Commit Graph

36 Commits

Author SHA1 Message Date
luukvbaal
48e2a73610
feat(ui)!: emit prompt "messages" as cmdline events #31525
Problem:  Prompts are emitted as messages events, where cmdline events
          are more appropriate. The user input is also emitted as
          message events in fast context, so cannot be displayed with
          vim.ui_attach().
Solution: Prompt for user input through cmdline prompts.
2025-01-02 05:51:03 -08:00
Justin M. Keyes
2a7d0ed614
refactor: iwyu #31637
Result of `make iwyu` (after some "fixups").
2024-12-23 05:43:52 -08:00
luukvbaal
1b6442034f
fix(messages): more ext_messages kinds #31279
Add kinds for various commands that output a list, the 'wildmode'
list, and for number prompts.
2024-11-20 12:11:20 -08:00
bfredl
ff7518b83c refactor(highlight): make enum of builtin highlights start with 1
This makes it possible to use HLF_ values directly as highlight id:s
and avoids +1 adjustments especially around messages.
2024-11-13 11:20:10 +01:00
Luuk van Baal
5cfa7a72f8 refactor(message): propagate highlight id instead of attrs
Problem:  Highlight group id is not propagated to the end of the message call
          stack, where ext_messages are emitted.
Solution: Refactor message functions to pass along highlight group id
          instead of attr id.
2024-11-08 13:21:35 +01:00
Justin M. Keyes
5d7853f229
refactor(os/input.c): rename os_inchar => input_get #30327
Problem:
The name `os_inchar` (from Vim's old `mch_inchar`) is ambiguous:
"inchar" sounds like it could be reading or enqueuing (setting) input.
Its docstring is also ambiguous.

Solution:
- Rename `os_inchar` to `input_get`.
- Write some mf'ing docstrings.
- Add assert() in TRY_READ().
2024-09-10 01:14:18 -07:00
zeertzjq
7aa56370f3
vim-patch:9.0.2114: overflow detection not accurate when adding digits (#28271)
Problem:  overflow detection not accurate when adding digits
Solution: Use a helper function

Use a helper function to better detect overflows before adding integer
digits to a long or an integer variable respectively. Signal the
overflow to the caller function.

closes: vim/vim#13539

22cbc8a4e1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-11 09:34:43 +08:00
dundargoc
63b810c9d8
docs: small fixes (#27213)
Co-authored-by: Matthieu Coudron <886074+teto@users.noreply.github.com>
2024-02-06 19:30:02 +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
c89292fcb7 refactor: follow style guide 2023-12-30 12:45:38 +01:00
dundargoc
ab2aad509d refactor: follow style guide 2023-12-24 12:36:59 +01: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
dundargoc
69bc519b53 refactor: move non-symbols to defs.h headers 2023-12-17 19:03:18 +01:00
zeertzjq
a6cba103ce
refactor: move some constants out of vim_defs.h (#26298) 2023-11-29 20:32:40 +08:00
dundargoc
79b6ff28ad refactor: fix headers with IWYU 2023-11-28 22:23:56 +01:00
dundargoc
8b428ca8b7 build(IWYU): fix includes for func_attr.h 2023-11-27 18:06:57 +01:00
dundargoc
a827003e30 build: rework IWYU mapping files
Create mapping to most of the C spec and some POSIX specific functions.
This is more robust than relying files shipped with IWYU.
2023-11-25 17:41:33 +01:00
zeertzjq
9d39ad6318 vim-patch:9.0.2111: [security]: overflow in get_number
Problem:  [security]: overflow in get_number
Solution: Return 0 when the count gets too large

[security]: overflow in get_number

When using the z= command, we may overflow the count with values larger
than MAX_INT. So verify that we do not overflow and in case when an
overflow is detected, simply return 0

73b2d3790c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-17 07:19:14 +08:00
dundargoc
353a4be7e8 build: remove PVS
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.
2023-11-12 21:26:39 +01:00
dundargoc
acc646ad8f refactor: the long goodbye
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.
2023-11-05 20:19:06 +01:00
zeertzjq
cf8b2c0e74
build(iwyu): add a few more _defs.h mappings (#25435) 2023-09-30 12:05:28 +08:00
bfredl
bc13bc154a refactor(message): smsg_attr -> smsg 2023-09-29 16:36:04 +02:00
dundargoc
3b0df1780e
refactor: uncrustify
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
2023-04-26 23:23:44 +02:00
zeertzjq
f113cba3ec
refactor(getchar.c): change most char_u to uint8_t (#22444) 2023-02-28 08:49:02 +08:00
dundargoc
27177e5819
refactor: reduce scope of locals as per the style guide (#22211) 2023-02-11 14:14:24 +01:00
dundargoc
4be6c6cf0d
refactor: replace char_u with char (#21901)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-02-11 11:05:57 +01:00
zeertzjq
b4d669e7ac
vim-patch:8.2.4928: various white space and cosmetic mistakes (#21854)
Problem:    Various white space and cosmetic mistakes.
Solution:   Change spaces to tabs, improve comments.

6ed545e797

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-17 16:53:37 +08:00
dundargoc
66360675cf build: allow IWYU to fix includes for all .c files
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.
2022-11-15 10:30:03 +01:00
dundargoc
d7358118aa
fix: compiler warnings from clang 15 (#20321)
Add -Wno-strict-prototypes flag to external dependencies to suppress
cjson warnings. These needs to be fixed upstream first.
2022-09-28 10:53:44 +02:00
zeertzjq
f58a979599
vim-patch:9.0.0318: clearing screen causes flicker (#19993)
Problem:    Clearing screen causes flicker.
Solution:   Do not clear but redraw in more cases.  Add () to "wait_return".
13608d851a

Only 2 lines of actual code change.
2022-08-30 06:26:06 +08:00
zeertzjq
9aa5647e68
vim-patch:8.2.4911: the mode #defines are not clearly named (#18499)
Problem:    The mode #defines are not clearly named.
Solution:   Prepend MODE_.  Renumber them to put the mapped modes first.
249591057b

A hunk from the patch depends on patch 8.2.4861, which hasn't been
ported yet, but that should be easy to notice.
2022-05-10 07:58:58 +08:00
Dundar Goc
2a378e6e82 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-07 14:54:01 +02:00
zeertzjq
f6afc7c324 revert: "refactor: Remove allow_keys global (#6346)" 2022-04-29 15:51:04 +08:00
Dundar Göc
7e3bdc75e4 refactor(uncrustify): format all c files 2022-03-10 09:14:12 +01:00
zeertzjq
6e69a3c3e7 refactor: remove CSI unescaping and clean up related names and comments 2022-01-21 18:08:56 +08:00
Björn Linse
df54d82b7c refactor(misc1): move out high-level input functions to a new file: input.c
Possibly dialog code is messages.c could be moved here as well.
misc1.c is now empty, so delete it.
2021-12-10 18:15:33 +01:00