aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
Commit message (Collapse)AuthorAge
...
* api/vim: allow guis and tests to retrieve the entire color tableBjörn Linse2015-02-02
|
* Add EndOfBuffer hl group for ~ lines after the last line in buffersMarco Hinz2015-02-02
| | | | | | | | 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
* Remove long_u: (various): Refactor long_u.Eliseo Martínez2015-01-19
|
* Merge pull request #1816 from Pyrohh/macro_cleanupJustin M. Keyes2015-01-15
|\ | | | | Macro cleanup
| * Macro cleanup: MiscellaneousMichael Reed2015-01-14
| | | | | | | | | | | | 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.
| * Macro cleanup: PROTOMichael Reed2015-01-14
| | | | | | | | | | | | 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.
* | main: Fix color schemes for abstract_uiThiago de Arruda2015-01-13
| | | | | | | | | | | | | | | | | | - 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.
* | syntax: Refresh UI when the color scheme changesThiago de Arruda2015-01-13
| |
* | ui: Add 'rgb' parameter to ui_attachThiago de Arruda2015-01-13
| | | | | | | | When set to false, nvim will send cterm color numbers with `highlight_set`.
* | syntax: Take rgb fg/bg when allocating cterm attr numberThiago de Arruda2015-01-13
| |
* | ui: Fix ui resizing and change some method namesThiago de Arruda2015-01-13
| |
* | ui: Add update_fg/update_bg methodsThiago de Arruda2015-01-13
|/ | | | | It is necessary to notify the UI when the default background/foreground colors change in order to render correctly.
* Remove QNX/pterm remnantsMichael Reed2015-01-11
| | | | | The function qnx_init() (wrapped in an ifdef in main.c) doesn't even exist.
* Cleanup: Rename getdigits() family functions.Eliseo Martínez2015-01-11
|
* Cleanup: Refactor getdigits().Eliseo Martínez2015-01-11
| | | | | | | | | | | | | | | | 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.
* Remove long_u: term: Enable -Wconversion.Eliseo Martínez2015-01-10
|
* Define and use the ARRAY_SIZE macroFelipe Oliveira Carvalho2014-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix warnings: syntax.c: get_id_list(): Double free: FP.Eliseo Martínez2014-12-17
| | | | | | | | | | | | | 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.
* Simple refatorings that didn't fit the pattern of the last commitFelipe Oliveira Carvalho2014-12-13
|
* Reduce indentation level by early returning or continuing loopFelipe Oliveira Carvalho2014-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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; } ... ... ... } ```
* Use GA_DEEP_CLEAR where appropriateFelipe Oliveira Carvalho2014-12-11
|
* syntax: Use RGB/GUI attribute information for "abstract_ui"Thiago de Arruda2014-12-08
| | | | | | | | 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.
* ui: Remove redundant ui.h includesThiago de Arruda2014-11-27
| | | | Also move read_error_exit to os/input.c
* ui: Remove ui_delay, ui_breakcheck and ui_set_shellsizeThiago de Arruda2014-11-27
| | | | | These functions only used to call another os_* function, so remove them and replace all occurences in the project.
* Fix warnings: syntax.c: get_id_list(): Double free: FP.Eliseo Martínez2014-11-15
| | | | | | | | | | | | 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.
* Fix warnings: syntax.c: syn_regexec(): Uninitialized arg: MI.Eliseo Martínez2014-11-15
| | | | | | | | 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.
* Replace FOR_ALL_WINDOWS with FOR_ALL_WINDOWS_IN_TAB(curtab)Wayne Rowcliffe2014-09-24
|
* Convert FOR_ALL_WINDOWS to use a locally declared pointerWayne Rowcliffe2014-09-08
|
* vim-patch:7.4.318 #968André Twupack2014-08-18
| | | | | | | 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
* clang-analyzer: Reduce scope in syntax.c.Florian Walch2014-08-07
|
* vim: move disptick_T from vim.h to syntax_defs.hNicolas Hillegeer2014-07-16
| | | | Make vim.h smaller, bit by bit.
* profiling: implement on top of os_hrtime()Nicolas Hillegeer2014-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | 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/...
* Include stdbool.h in some files which use itPavel Platto2014-07-11
| | | | | | | 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
* move errno.h include out of vim.hBrandon Coleman2014-07-09
|
* move assert.h include out of vim.hBrandon Coleman2014-07-09
|
* move <inttypes.h> include out of vim.hBrandon Coleman2014-07-09
|
* move ascii.h include out of vim.hBrandon Coleman2014-07-09
|
* Replaced most TRUE/FALSE macros in arabic, mbyte and spell. #645Klemen Košir2014-07-08
|
* Replace int with bool in some files. #654Klemen Košir2014-07-08
|
* Introduce ga_append_via_ptr() and GA_APPEND_VIA_PTR()Felipe Oliveira Carvalho2014-06-30
| | | | | | | | | | 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++;
* Introduce GA_APPEND()Felipe Oliveira Carvalho2014-06-30
| | | | | | | | | 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;
* ga_growsize should be >= 1Felipe Oliveira Carvalho2014-06-30
| | | | | | | | | | | 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
* No OOM in vim_strnsave_up()Felipe Oliveira Carvalho2014-06-16
| | | | And some cleanup in strsave_up()
* Replace vim_strncpy calls: syntax.cDouglas Schneider2014-06-13
|
* coverity/13770: add_keyword(), mark as false pos.Nicolas Hillegeer2014-06-12
| | | | Also cleaned up the function a little bit.
* Declare garray iterators in the for() scope where possible #819Felipe Oliveira Carvalho2014-06-10
|
* Add automatic generation of headersZyX2014-06-02
| | | | | | | | | | | | | | | | | - 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.
* Remove FEAT_STL_OPTHinidu2014-05-28
| | | | | 'statusline', 'rulerformat' and special format of 'titlestring' and 'iconstring' options
* Remove FEAT_CMDL_COMPLHinidu2014-05-28
| | | | Completion of mappings/abbreviations in command line mode
* Replace alloc() with xmalloc() and remove immediate OOM checksFelipe Oliveira Carvalho2014-05-19
|