| Commit message (Collapse) | Author | Age |
... | |
| |
|
| |
|
|
|
|
| |
- test/README.md: document luassert `TableFormatLevel`
- CONTRIBUTING.md: absorb parts of the old "Development tips" wiki page
|
| |
|
|
|
|
|
|
| |
- These "alternative tokens" keywords are for C++, not C.
- The check sometimes has false positives, e.g. `compl` is a variable
name in edit.c
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes handing of "-" on Python 3:
Traceback (most recent call last):
File "…/Vcs/neovim/src/clint.py", line 3625, in <module>
main()
File "…/Vcs/neovim/src/clint.py", line 3618, in main
ProcessFile(filename, _cpplint_state.verbose_level)
File "…/Vcs/neovim/src/clint.py", line 3464, in ProcessFile
'replace').read().split('\n')
File "/usr/lib/python3.7/codecs.py", line 701, in read
return self.reader.read(size)
File "/usr/lib/python3.7/codecs.py", line 500, in read
data = self.bytebuffer + newdata
TypeError: can't concat str to bytes
|
|
|
|
|
| |
Vim uses MAYBE for 3-value boolean with FALSE/TRUE/MAYBE.
Use TriState type instead to restrict to 3 values, kFalse/kTrue/kNone.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the old behavior, if a GUI makes a blocking request that requires user
interaction (like nvim_input()), it would not get any screen updates.
The client, not nvim, should decide how to handle notifications during a
pending request. If an rplugin wants to avoid async calls while a sync call is
busy, it likely wants to avoid processing async calls while another async call
also is handled as well.
This may break the expectation of some existing rplugins. For compatibility,
remote/define.vim reimplements the old behavior. Clients can opt-out by
specifying `sync=urgent`.
- Legacy hosts should be updated to use `sync=urgent`. They could add a flag
indicating which async methods are always safe to call and which must wait
until the main loop returns.
- New hosts can expose the full asyncness, they don't need to offer both
behaviors.
ref #6532
ref #1398 d83868fe9071af1b4866594eac12f7aa0fa71b53
|
| |
|
| |
|
| |
|
|\ |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
memcpy is not equivalent to memmove (which is used by vim_strcat), this
could cause subtle bugs if xstrlcat is used as a replacement for
vim_strcat. But vim_strcat is inconsistent: in the `else` branch it uses
strcpy, which doesn't allow overlap.
Helped-by: oni-link <knil.ino@gmail.com>
Helped-by: James McCoy <jamessan@jamessan.com>
Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #731
References #851
Note: This does not remove some intentional legacy usages of strncpy.
- memcpy isn't equivalent because it doesn't check the string
length of `src`, and doesn't zero-out the remainder of `dst`.
- xstrlcpy isn't equivalent because it doesn't zero-out the
remainder of `dst`. Some Vim logic depends on that (e.g.
ex_append which calls vim_strnsave).
Helped-by: Douglas Schneider <ds3@ualberta.ca>
Helped-by: oni-link <knil.ino@gmail.com>
Helped-by: James McCoy <jamessan@jamessan.com>
|
| |
|
|
|
|
|
|
| |
It was a bit confusing for me when seeing it myself the first time.
[ci skip]
|
|\
| |
| | |
More clint brace checks
|
| | |
|
| |
| |
| |
| | |
For some reason that was incorrectly hidden by “file is *not* \*.c or \*.h file”
check.
|
|\ \
| | |
| | | |
shada: Save current cursor position before saving jumps
|
| |/
| |
| |
| | |
Python does not allow branching here, complaining that look-behind is not
fixed-width.
|
|/
|
|
|
| |
Except when they are system just in case. There should be no .c.h system files
though, but if there will be it is unlikely that they inherit the same
convention.
|
|
|
|
|
|
|
|
|
| |
Also adds one exception to linter rules:
typedef struct {
kvec_t(Object) stack;
} EncodedData;
is completely valid (from the style guide point of view) code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://neovim.io/develop/style-guide.xml#Horizontal_Whitespace
Note that this errors out for e.g.
if (has_mbyte) mb_copy_char((const char_u **)(&f), &t); \
(found in macros.h:151) or
#define ECMD_SET_HELP 0x02 /* set b_help flag of (new) buffer before
(found in ex_cmds.h:11) (note `(new) buffer`). I left this as-is because these
pieces of code are already caught by another rule (braces near if and `/*`-style
comments). Other false positives I found were:
1. `FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_WARN_UNUSED_RESULT`: rejected by
requiring type name to start with `[a-zA-Z_]` (this makes `1` not be
incorrectly recognized as a type).
2. `#define FOO(var) (var)`: rejected by creating `cast_line`.
3. `(expr) * (expr)`: rejected by constructing regexp so that unary operators
require no spaces after them.
4. `int f(void) FUNC_ATTR_PURE`: rejected by requiring line to start with
a space.
5. `"." STR(NVIM_VERSION_PATCH) NVIM_VERSION_PRERELEASE`: not rejected, such
thing should be rare and it would be easy to get rid of the false positive by
e.g. breaking line.
Struct literals like `(MyStruct) { 4, 2 }` are not checked:
1. I am not sure whether they are under this rule at all (this is not a cast).
2. It would be hard to get rid of false positives (like the example with `if`
above, but now for *valid* `if() {}`s).
|
|
|
|
|
| |
This is also not allowed by the style guide:
https://neovim.io/develop/style-guide.xml#Preprocessor_Directives.
|
|
|
|
|
|
|
| |
Rejected by https://neovim.io/develop/style-guide.xml#Horizontal_Whitespace.
Note: what to do with “empty” lines is not described in the style guide, neither
it is checked.
|
|
|