| Commit message (Collapse) | Author | Age |
... | |
| |
|
|
|
|
|
|
|
|
| |
This makes it possible to highlight the lines starting with ~ at the end
of buffers and other elements highlighted using NonText.
As proposed by mhinz at
https://groups.google.com/forum/#!topic/vim_dev/p3de1iU1GXI/discussion
|
| |
|
|\
| |
| | |
Macro cleanup
|
| |
| |
| |
| |
| |
| | |
These were found with -Wunused-macros. There are many more macros which
triggered that warning, but they were primarily part of larger sets of
macros so leave them alone.
|
| |
| |
| |
| |
| |
| | |
Regarding dict_lookup() in eval.c: both definitions are the same, the
only difference being the spacing between the indirection operator and
the indentation level.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Set 't_Co' to 256 at startup. The value can be changed by the user for
compatibility with terminals that are less capable.
- `has('gui_running')` will return 1 if at least one rgb UI is attached.
Even though these changes are hacky, they are necessary to make the transition
to the new UI architecture smoother.
|
| | |
|
| |
| |
| |
| | |
When set to false, nvim will send cterm color numbers with `highlight_set`.
|
| | |
|
| | |
|
|/
|
|
|
| |
It is necessary to notify the UI when the default background/foreground colors
change in order to render correctly.
|
|
|
|
|
| |
The function qnx_init() (wrapped in an ifdef in main.c) doesn't even
exist.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem : getdigits() currently returns a long, but at most places,
return value is casted (unsafely) into an int. Making casts
safe would introduce a lot of fuss in the form of assertions
checking for limits.
Note : We cannot just change return type to int, because, at some
places, legitimate long values are used. For example, in
diff.c, for line numbers.
Solution : Introduce new functions:
- get_digits() : Gets an intmax_t from a string.
- get_int_digits() : Wrapper for ints.
- get_long_digits() : Wrapper for longs.
And replace getdigits() invocations by the appropiate
wrapper invocations.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A similar macro is defined in the Linux kernel [1].
To refactor the code I used a slightly modified Coccinelle script I found in
[2].
```diff
// Use the macro ARRAY_SIZE when possible
//
// Confidence: High
// Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2.
// URL: http://www.emn.fr/x-info/coccinelle/rules/array.html
// Options: -I ... -all_includes can give more complete results
@@
type T;
T[] E;
@@
- (sizeof(E)/sizeof(*E))
+ ARRAY_SIZE(E)
@@
type T;
T[] E;
@@
- (sizeof(E)/sizeof(E[...]))
+ ARRAY_SIZE(E)
@@
type T;
T[] E;
@@
- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)
@n@
identifier AS,E;
@@
- #define AS(E) ARRAY_SIZE(E)
@@
expression E;
identifier n.AS;
@@
- AS(E)
+ ARRAY_SIZE(E)
```
`spatch --in-place --sp-file array_size.cocci -I src/ -I build/include/ -I build/src/nvim/auto/ src/nvim/*.c`
[1] http://lxr.free-electrons.com/source/include/linux/kernel.h#L54
[2] http://www.emn.fr/z-info/coccinelle/rules/#macros
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem : Double free @ 5213.
Diagnostic : False positive.
Rationale : I haven't been able to find the real reason why this is
signaled. Nonetheless, I've been able to track down the
introduction of this warning to commit
77135447e09903b45d1482da45869946212f7904.
The change there affecting this function is just a
transformation maintaining semantics. So, this must be a
FP, though I can't explain why.
Resolution : Revert changes in mentioned commmit touching this function.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace code like this
```c
func() {
if (cond) {
...
...
...
}
return ret;
}
```
```c
for (...) {
if (cond) {
...
...
...
}
}
```
with
```c
func() {
if (!cond) {
return ret;
}
...
...
...
}
```
```c
for (...) {
if (!cond) {
continue;
}
...
...
...
}
```
|
| |
|
|
|
|
|
|
|
|
| |
Instead of using classic cterm color numbers and attributes, treat "abstract_ui"
as a GUI: Pass rgb color numbers and gui attributes when the "highlight_set" UI
method is called. The terminal UI will have to translate RGB color information
to an appropriate color number, and the "term"/"cterm" :highlight keys will
eventually be deprecated.
|
|
|
|
| |
Also move read_error_exit to os/input.c
|
|
|
|
|
| |
These functions only used to call another os_* function, so remove them and
replace all occurences in the project.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem : Double free @ 5213.
Diagnostic : False positive.
Rationale : Suggested error path contains two consecutive invocations
of `ends_excmd(*p)` having different results, which is not
possible. First invocation is before the while loop. Second
invocation is the while loop condition itsef.
Resolution : Refactor while loop into do-while loop. That removes the
impossible path from analysis, and, in addition, is a bit
more efficient.
|
|
|
|
|
|
|
|
| |
Problem : Uninitialized argument value @ 2863.
Diagnostic : Multithreading issue.
Rationale : Error can only occur if global `syn_time_on` is changed
while the function is executing.
Resolution : Use local copy of gloval var.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Problem: Check for whether a highlight group has settings ignores fg and bg color settings.
Solution: Also check cterm and GUI color settings. (Christian Brabandt)
https://code.google.com/p/vim/source/detail?r=5c47dacf397c1c65d2dfc237b3ff395c66ec3d4d
|
| |
|
|
|
|
| |
Make vim.h smaller, bit by bit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Should be better than gettimeofday() since libuv uses higher resolution
clocks on most UNIX platforms. Libuv also tries to use monotonic clocks,
kernel bugs notwithstanding, which is another win over gettimeofday().
Necessary for Windows, which doesn't have gettimeofday(). In vanilla vim,
Windows uses QueryPerformanceCounter, which is the correct primitive for
this sort of things, but that was removed when slimming up the codebase.
Libuv uses QueryPerformanceCounter to implement uv_hrtime() on Windows so
the behaviour of vim profiling on Windows should now be the same.
The behaviour on Linux should be different (better) though, libuv uses more
accurate primitives than gettimeofday().
Other misc. changes:
- Added function attributes where relevant (const, pure, ...)
- Convert functions to receive scalars: Now that proftime_T is always a
(uint64_t) scalar (and not a struct), it's clearer to convert the
functions to receive it as such instead of a pointer to a scalar.
- Extract profiling funcs to profile.c: make everything clearer and reduces
the size of the "catch-all" ex_cmds2.c
- Add profile.{c,h} to clint and -Wconv:
- Don't use sprintf, use snprintf
- Don't use long, use int16_t/int32_t/...
|
|
|
|
|
|
|
| |
Done by manual inspection of the output of this script:
grep -r -l -w "bool\|true\|false" * | grep 'c$\|h$' > has_bool
grep -r -l "stdbool.h" * | grep 'c$\|h$' > has_include
grep -F -x -v -f has_include has_bool
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Similar to GA_APPEND(). Replaces this pattern:
ga_grow(&ga, 1);
item_type *p = ((item_type *)ga.ga_data) + ga.ga_len;
p->field1 = v1;
p->field2 = v2;
ga.ga_len++;
|
|
|
|
|
|
|
|
|
| |
This macro is used to append an element to a growable array. It replaces this
common idiom:
ga_grow(&ga, 1);
((item_type *)ga.ga_data)[ga.ga_len] = item;
++ga.ga_len;
|
|
|
|
|
|
|
|
|
|
|
| |
I know it could be 0 sometimes. Running the tests with
`assert(gap->ga_growsize > 0)` in ga_grow() crashes nvim while running the
tests.
- Add a setter for ga_growsize that checks whether the value passed is >=1 (log
in case it's not)
- log when ga_grow() tries to use a ga_growsize that's not >=1
- use GA_EMPTY_INIT_VALUE is many places
|
|
|
|
| |
And some cleanup in strsave_up()
|
| |
|
|
|
|
| |
Also cleaned up the function a little bit.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- The 'stripdecls.py' script replaces declarations in all headers by includes to
generated headers.
`ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'`
was used for this.
- Add and integrate gendeclarations.lua into the build system to generate the
required includes.
- Add -Wno-unused-function
- Made a bunch of old-style definitions ANSI
This adds a requirement: all type and structure definitions must be present
before INCLUDE_GENERATED_DECLARATIONS-protected include.
Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is
the only exception.
|
|
|
|
|
| |
'statusline', 'rulerformat' and special format of 'titlestring' and
'iconstring' options
|
|
|
|
| |
Completion of mappings/abbreviations in command line mode
|
| |
|