Commit Graph
74 Commits
Author SHA1 Message Date
Dundar Goc e31b32a293 refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
2022-05-09 10:03:29 +02:00
Dundar Goc d0897243f6 build(clint): remove "function size is too large" warning
This warning is essentially only triggered for ported vim functions.
It's unlikely that we'll refactor vim functions solely based on their
size since it'd mean we'd greatly deviate from vim, which is a high cost
when it comes to importing the vim patches. Thus, this warning only
serves as an annoyance and should be removed.
2022-05-06 18:03:57 +02:00
zeertzjq 27149e0071 vim-patch:8.2.4858: K_SPECIAL may be escaped twice
Problem:    K_SPECIAL may be escaped twice.
Solution:   Avoid double escaping. (closes vim/vim#10340)
https://github.com/vim/vim/commit/db08887f24d20be11d184ce321bc0890613e42bd
2022-05-03 06:21:50 +08:00
Dundar Goc eef8de4df0 refactor(uncrustify): change rules to better align with the style guide
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.
2022-04-29 14:13:06 +02:00
zeertzjq d531ef6813 vim-patch:8.2.0867: using \{xxx} for encoding a modifier is not nice
Problem:    Using \{xxx} for encoding a modifier is not nice.
Solution:   Use \<*xxx> instead, since it's the same as \<xxx> but producing a
            different code.
https://github.com/vim/vim/commit/fccd93f0917234b962ce07d1df3adf9d7105936f

Use this notation in langmap_spec.
2022-04-29 15:51:04 +08:00
zeertzjq abe91e1efe vim-patch:8.2.0855: GUI tests fail because the test doesn't use a modifier
Problem:    GUI tests fail because the test doesn't use a modifier.
Solution:   Add "\{xxx}" to be able to encode a modifier.
https://github.com/vim/vim/commit/ebe9d34aa07037cff2188a8dd424ee1f59cbb0bf

Change macros to enums to use them in unit tests.
2022-04-29 15:51:04 +08:00
zeertzjq dde4f09f51 vim-patch:8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Problem:    Cannot map <C-H> when modifyOtherKeys is enabled.
Solution:   Add the <C-H> mapping twice, both with modifier and as 0x08.  Use
            only the first one when modifyOtherKeys has been detected.
https://github.com/vim/vim/commit/459fd785e4a8d044147a3f83a5fca8748528aa84

Add REPTERM_NO_SPECIAL instead of REPTERM_SPECIAL because the meaning of
"special" is different between Vim and Nvim.
Omit seenModifyOtherKeys as Nvim supports attaching multiple UIs.
Omit tests as they send terminal codes.
Keep the behavior of API functions.
2022-04-29 15:51:03 +08:00
dundargoc 0648100fed refactor: convert macros to all-caps (#17895)
Closes https://github.com/neovim/neovim/issues/6297
2022-04-24 20:18:43 -06:00
Dundar Göc da89725f34 fix(coverity/175977): big parameter passed by value 2022-02-26 21:46:05 +01:00
0b0c4f7dfa chore: fix typos (#16816)
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Sebastian Volland <seb@baunz.net>
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-01-04 11:07:40 -07:00
Dundar Göc 849f104c27 refactor: upgrade uncrustify config version to 0.74.0
Disable formatting for assert.h since there's a bug that results in a
segmentation fault in uncrustify.
2021-11-23 10:28:49 +01:00
dundargoc 725cbe7d41 refactor: saner options for uncrustify (#16204)
* 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-11-19 14:21:53 -05:00
dundargoc 4472c56d54 refactor: uncrustify #16090 2021-10-29 17:23:20 -07:00
dundargoc d90fb1c0bf Refactor/uncrustify (#15790)
* refactor: format with uncrustify

* fixup(dundar): fix functions comments

* fixup(dundar): remove space between variable and ++/--

* fixup(dundar): better workaround for macro attributes

This is done to be able to better use uncrustify rules for macros

* fixup(justin): make preprocessors follow neovim style guide
2021-09-29 19:48:50 +02:00
dundargoc 51a98aa0c2 refactor: format #15702 2021-09-18 09:34:23 -07:00
Oliver Marriott d9f93e5642 fix(typo): overriden -> overridden (RE: PR #14159) (#15360) 2021-09-17 13:07:00 -04:00
Sean Dewar 34cb087955 vim-patch:8.1.1355: obvious mistakes are accepted as valid expressions
Problem:    Obvious mistakes are accepted as valid expressions.
Solution:   Be more strict about parsing numbers. (Yasuhiro Matsumoto,
            closes vim/vim#3981)
https://github.com/vim/vim/commit/16e9b85113e0b354ece1cb4f5fcc7866850f3685

Update vim_str2nr_spec.lua to add more tests that use strict = true.
2021-09-11 15:33:19 +01:00
James McCoy 27a7a4d384 Use abort() instead of assert(false) for things that should never happen
assert() is compiled out for release builds, but we don't want to
continue running in these impossible situations.

This also resolves the "implicit fallthrough" warnings for the asserts
in switch cases.
2021-01-31 11:28:52 -05:00
Björn Linse b33e375b2b robustness: avoid adding offset to NULL pointer
UBSAN with clang 10.0 is checking for adding offsets to a `NULL` pointer
which is not allowed. This is not yet checked in the version of clang
used in CI (7.0.0). I will work on cases of this so that tests passes
locally for me.

This could be tested in CI by either upgrading the clang of the
ASAN/UBSAN to 10.0, or add yet another CI target which builds with
clang 10.0.
2020-09-04 23:29:51 +02:00
Jakub Łuczyński 937da5dd7e Removed redundant define 2020-02-13 14:11:42 +01:00
Bartosz Miera 16727dcf1e clang/"dead assignments" #10620
Also revert possibly-wrong change in f_sign_getplaced() from
652be3cb00.
2019-07-29 00:52:24 +02:00
Justin M. Keyes 6abdc0aeec PVS/V547: viml/parser/expressions.c: Expression is always true 2019-01-04 02:29:38 +01:00
Justin M. Keyes 53f11dcfc7 Merge #8218 'Fix errors reported by PVS'
closes #4983
2018-04-27 09:25:02 +02:00
ZyX a20261fae7 viml/parser/expressions: Fix PVS/V547: condition checked earlier
See previous goto with the same label.
2018-04-15 20:11:21 +03:00
ZyX bc235bf1f6 viml/parser/expressions: Fix PVS/V547: condition checked earlier
See previous goto with the same label.
2018-04-15 20:10:48 +03:00
Marco Hinz 929a732d00 build/clang 6.0.0: fix type conversion warnings (#8235) 2018-04-07 16:20:31 +02:00
ZyX 5ab0f988ca *: Replace all occurrences of NVim with Nvim 2017-11-30 11:53:25 +03:00
ZyX de45ec0146 keymap: Do not use vim_isIDc in keymap.c
Note: there are three changes to ascii_isident. Reverting first two (in 
find_special_key and first in get_special_key_code) normally fails the new test 
with empty &isident, but reverting the third does not. Hence adding `>` to 
&isident.

Ref vim/vim#2389.
2017-11-30 02:01:49 +03:00
ZyX 36a4f3a259 viml/parser/expressions: Make sure that listed nodes may be present
With the new test leaving `assert(false);` for any of the cases makes tests 
crash.
2017-11-26 16:57:42 +03:00
ZyX 17077b6813 viml/parser/expressions: Make $ENV not depend on &isident 2017-11-26 16:08:53 +03:00
ZyX f20f97c936 *: Fix linter errors 2017-11-19 21:13:27 +03:00
ZyX c287893225 viml/parser/expressions,unittests: Do better testing, fix found issues 2017-11-19 19:22:54 +03:00
ZyX 342239a9c5 unittests,viml/parser/expressions: Start adding asgn parsing tests 2017-11-13 01:11:13 +03:00
ZyX 45445e2e03 unittests: Add some more edge test cases 2017-11-12 03:52:26 +03:00
ZyX c7495ebcc0 viml/parser/expressions: Add support for parsing assignments 2017-11-12 02:18:43 +03:00
ZyX 1aa6276c29 viml/parser/expressions: Replace lambda-specific WantedNode entries
This way code will be easier to adapt to handling (partially) non-expressions 
like :let lvalue part or :function definitions, and that would be needed in the 
future both for proper completion support and for the Ex commands parser.
2017-11-12 00:03:45 +03:00
ZyX 4aebd00a9e *: Fix linter errors 2017-11-06 20:28:37 +03:00
ZyX 05f775b5f2 viml/parser/expressions: Briefly document some differences 2017-11-06 01:57:22 +03:00
ZyX 7bc6de7526 api/vim,functests: Add tests for nvim_parse_expression, fix found bugs 2017-11-06 01:17:39 +03:00
ZyX 07ec709141 vim/api: Actually dump AST, fix some bugs in nvim_parse_expression 2017-11-06 01:17:38 +03:00
ZyX a9b203d23f *: Fix linter errors
Big function in expressions.c may be refactored, if I ever catch the idea how to 
split it right.
2017-10-30 01:32:10 +03:00
ZyX 538af1c90a syntax,viml/parser/expressions: Add missing highlight groups
Also adjusts some names.
2017-10-29 22:02:19 +03:00
ZyX 748f3ad5bb syntax,viml/expressions/parser: Create defaults for expr highlighting 2017-10-29 21:30:06 +03:00
ZyX 22d161a5dd api/vim: Add nvim_parse_expression function 2017-10-29 20:11:44 +03:00
ZyX 568cf73c90 viml/parser/expressions: Fix last error found by KLEE 2017-10-29 01:29:48 +03:00
ZyX 47938e1e22 viml/parser/expressions: Fix some errors spotted by KLEE
Not all of them are fixed yet though.
2017-10-19 10:48:05 +03:00
ZyX 895793fc82 viml/parser/expressions: Add some casts 2017-10-16 09:14:02 +03:00
ZyX 4c8ed65b60 viml/parser/expressions: Fix memory leak when processing ternary 2017-10-16 03:04:22 +03:00
ZyX fe81380bf5 viml/parser/expressions: Highlight prefix separately from number
Should make accidental octals more visible.
2017-10-16 00:30:55 +03:00
ZyX 2cb95bd937 viml/parser/expressions: Define east_node_type_tab only when needed 2017-10-15 21:39:01 +03:00