Commit Graph

27 Commits

Author SHA1 Message Date
zeertzjq
3a91adabda
refactor: rename keymap.{c,h} to keycodes.{c,h} (#18535)
Most code in keymap.h is for keycode definitions, while most code in
keymap.c is for the parsing and conversion of keycodes.

The name "keymap" may also make people think these two files are for
mappings, while in fact keycodes are used even when no mappings are
involved, so "keycodes" should be a better file name than "keymap".
2022-05-12 20:19:29 +08: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
Jan Edmund Lazo
35874208b8
globals: eliminate "has_mbyte" macro
"has_mbyte" always evaluates to "true".
Continue dead code removal, started in https://github.com/neovim/neovim/pull/13275.
2020-11-14 17:23:51 -05:00
Hansraj Das
1709210a53
Fix multiple typos (#13063)
* Fix multiple typos in `src/nvim/api/ui_events.in.h`
* Below spellings are corrected:
  * Definitions
  * Revision
  * Performance

* Typo fix `presense` should be presence

* Typo fix, follwed -> followed

* Typo fix, attemping -> attempting

* Typo fix, duplicate 'the'

* Typo fix, bounaries -> boundaries

* Revert "Typo fix, bounaries -> boundaries"

This reverts commit 24779e55e596f7534585938a7e532830ad2fa83c.

* Revert "Typo fix, duplicate 'the'"

This reverts commit 1d41d74f78736e67821a15edc9c174a2c3024f87.

* Revert "Typo fix, attemping -> attempting"

This reverts commit d8b2860dfcac366af7afae1f09946ed0aee4a34e.
2020-10-12 09:28:12 +02:00
Olivier G-R
f6fb370b1b keymap: add more (keypad) keycodes #9793
- K_KORIGIN instead of K_KCENTER: This name is similar to what is used
  by xev. Alternative could be K_KBEGIN as hinted here:
  https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-PC-Style-Function-Keys
  But I find Begin and Home too similar, and it might induced some
  confusion. The naming looked related to some old keyboard
  configuration.

- keymap.c: alias KPPeriod to kDel instead of kPoint.
  This might seems weird, but this is actually the behaviour that should
  be expected. libtermkey produces "KPPeriod" when num lock is off. To
  fix this would need to change this name in termkey.

closes #9780
closes #9793
2019-03-29 01:11:57 +01: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
342239a9c5 unittests,viml/parser/expressions: Start adding asgn parsing tests 2017-11-13 01:11:13 +03:00
ZyX
c7495ebcc0 viml/parser/expressions: Add support for parsing assignments 2017-11-12 02:18:43 +03:00
ZyX
d98199de9c charset: Refactor vim_str2nr 2017-11-06 01:17:38 +03:00
ZyX
06bdc9ed83 klee: Update vim_str2nr in mock as well 2017-10-29 01:40:55 +03:00
ZyX
c9f511d24a viml/parser/expressions: Remove unused flag 2017-10-16 09:06:05 +03:00
ZyX
8e856ebcd0 klee: Add run.sh --help and run.sh -s 2017-10-16 09:00:39 +03:00
ZyX
c03dc13bb7 klee: Fix possible assertion error
No idea how it did not happen to hit me yet.
2017-10-16 03:05:27 +03:00
ZyX
15043e93b6 klee: Update key_name_entry table 2017-10-16 00:41:41 +03:00
ZyX
ed253b5fe6 klee: Include colors in test 2017-10-16 00:39:48 +03:00
ZyX
5e92ee6565 charset: Do not call strlen() from vim_str2nr 2017-10-16 00:19:02 +03:00
ZyX
1a3635304b charset: Avoid overflow in vim_str2nr 2017-10-16 00:07:32 +03:00
ZyX
3aa2c0d63a viml/parser/expressions,klee: Fix some problems found by KLEE run 2017-10-15 21:11:00 +03:00
ZyX
6c19cbef26 viml/parser/expressions,tests: Add AST freeing, with sanity checks 2017-10-15 20:05:35 +03:00
ZyX
c286155bfa viml/parser/expressions: Create tests for latest additions 2017-10-15 19:13:52 +03:00
ZyX
8178ba2871 klee: Fix some errors made in …parser.c 2017-10-15 19:13:52 +03:00
ZyX
fa3cfc0dd5 viml/parser/expressions: Finish parser
Note: formatc.lua was unable to swallow some newer additions to ExprASTNodeType 
(specifically `kExprNodeOr = '|'` and probably something else), so all `= …` 
were dropped: in any case they only were there in order to not bother updating 
viml_pexpr_debug_print_ast_node and since it is now known all nodes which will 
be present it is not much of an issue.
2017-10-15 19:13:52 +03:00
ZyX
af38cea133 viml/parser/expressions: Add support for string parsing 2017-10-15 19:13:52 +03:00
ZyX
163792e9b9 viml/parser/expressions: Make lexer parse numbers, support non-decimal 2017-10-15 19:13:50 +03:00
ZyX
6168e1127c viml/parser/expressions: Add support for comparison operators 2017-10-15 19:13:49 +03:00
ZyX
9fa8f7fc0a viml/parser/expressions: Add a way to adjust lexer
It also adds support for kExprLexOr which for some reason was forgotten.

It was only made sure that KLEE test compiles in non-KLEE mode, not that
something works or that KLEE is able to run tests.
2017-10-08 22:25:08 +03:00
ZyX
7c97f78393 klee: Start preparing for klee tests
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-08 22:25:05 +03:00