aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
Commit message (Collapse)AuthorAge
* build: enable -WshadowJustin M. Keyes2019-01-02
| | | | | | | | | | Note about shada.c: - shada_read_next_item_start was intentionally shadowing `unpacked` and `i` because many of the macros (e.g. ADDITIONAL_KEY) implicitly depended on those variable names. - Macros were changed to parameterize `unpacked` (but not `i`). Macros like CLEAR_GA_AND_ERROR_OUT do control-flow (goto), so any other approach is messy.
* vim-patch:8.1.0098: segfault when pattern with \z() is very slow (#9283)Justin M. Keyes2018-11-29
| | | | | | | | Problem: Segfault when pattern with \z() is very slow. Solution: Check for NULL regprog. Add "nfa_fail" to test_override() to be able to test this. Fix that 'searchhl' resets called_emsg. https://github.com/vim/vim/commit/bcf9442307075bac40d44328c8bf7ea21857b138 closes #8788
* diff/highlight: do not overlay low-priority CursorLineJustin M. Keyes2018-11-27
| | | | ref #6380
* ui: disable clearing almost everywhereBjörn Linse2018-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid clearing the screen in most situations. NOT_VALID should be equivalent to CLEAR unless some external force messed up the terminal, for these situations <c-l> and :mode will still clear the screen. Also eliminate some obsolete code in screen.c, that dealt with that in vim drawing window 1 can mess up window 2, but this never happens in nvim. But what about slow terminals? There is two common meanings in which a terminal is said to be "slow": Most commonly (and in the sense of vim:s nottyfast) it means low bandwidth for sending bytes from nvim to the terminal. If the screen is very similar before and after the update_screen(CLEAR) this change should reduce bandwidth. If the screen is quite different, but there is no new regions of contiguous whitespace, clearing doesn't reduce bandwidth significantly. If the new screen contains a lot of whitespace, it will depend of if vsplits are used or not: as long as there is no vsplits, ce is used to cheaply clear the rest of the line, so full-screen clear is not needed to reduce bandwith. However a left vsplit currently needs to be padded with whitespace all the way to the separator. It is possible ec (clear N chars) can be used to reduce bandwidth here if this is a problem. (All of this assumes that one doesn't set Normal guibg=... on a non-BCE terminal, if you do you are doomed regardless of this change). Slow can also mean that drawing pixels on the screen is slow. E-ink screens is a recent example. Avoiding clearing and redrawing the unchanged part of the screen will always improve performance in these cases.
* vim-patch:8.0.1777: cannot cleanup before loading another colorscheme (#9104)Jan Edmund Lazo2018-10-11
| | | | | Problem: Cannot cleanup before loading another colorscheme. Solution: Add the ColorSchemePre autocommand event. https://github.com/vim/vim/commit/60a68362aa73f4a6cb534688978f9dc2b16e60fe
* ui: rename ext_newgrid to ext_linegridBjörn Linse2018-10-01
|
* startup: don't erase screen on `:hi Normal` during startupBjörn Linse2018-09-20
| | | | | | | | | NB: existing `color default` test was actually enough to trigger the bug, when ext_newgrid=false is used. I created the `:hi Normal` test as I thought the builtin colors wouldn't set Normal (unless 'bg' is changed) But as the root cause actually comes from `:hi Normal`, it makes sense to still add the separate test (if `color default` here gets optimized to become a no-op, or something).
* startup: wait for embedder before executing startup commands and filesBjörn Linse2018-09-18
| | | | | | Give embeders a chance to set up nvim, by processing a request before startup. This allows an external UI to show messages and prompts from --cmd and buffer loading (e.g. swap files)
* lint: cleanup after parent commitsZviRackover2018-08-16
|
* Remove has_mbyte from lines near changes in parent commitZviRackover2018-08-16
|
* Remove occurences of mb_head_offZviRackover2018-08-15
|
* cursor_shape: use attribute ids instead of syntax idsBjörn Linse2018-08-13
| | | | | As attribute ids is the convention in the UI protocol Also remove non-threadsafe calls in tui.c to syntax module.
* Remove some occrrences of enc_utf8 and has_mbyteZviRackover2018-08-06
| | | | | Removing uses and related dead code in the locallity of changes of the two parent commits.
* Remove all occurences of the mb_ptr2char macroZviRackover2018-08-06
| | | | | | | First step towards implemening issue #7401. The same can be done for all deprecated mb_ functions in follow-up patches.
* Merge #8742 vim-patch:8.0.0791,0831,1072,1078,1088Justin M. Keyes2018-08-04
|\
| * vim-patch:8.0.1088: occasional memory use after freeJan Edmund Lazo2018-07-29
| | | | | | | | | | | | Problem: Occasional memory use after free. Solution: Use the highlight table directly, don't keep a pointer. https://github.com/vim/vim/commit/414168d97fad45387a3d7dd16449d15b27079ad8
| * vim-patch:8.0.1078: using freed memory with ":hi Normal"Jan Edmund Lazo2018-07-29
| | | | | | | | | | | | Problem: Using freed memory with ":hi Normal". Solution: Get "item" again after updating the table. https://github.com/vim/vim/commit/b4ea1914b8ca7c368253bd96e6b3cb9e3392da1c
| * vim-patch:8.0.1072: :highlight command causes a redraw even when nothing changedJan Edmund Lazo2018-07-29
| | | | | | | | | | | | Problem: The :highlight command causes a redraw even when nothing changed. Solution: Only set "need_highlight_changed" when an attribute changed. https://github.com/vim/vim/commit/99433291b135094d9592c41f96d3ccd60073e2c1
| * vim-patch:8.0.0831: with 8 colors the bold attribute is not set properlyJan Edmund Lazo2018-07-29
| | | | | | | | | | | | | | | | Problem: With 8 colors the bold attribute is not set properly. Solution: Move setting HL_TABLE() out of lookup_color. (closes vim/vim#1901) https://github.com/vim/vim/commit/12d853fae1fc37c33874b5cf1e40a2dfaf04268c Use TriState on lookup_color() to avoid 'NOLINT' comments.
| * vim-patch:8.0.0791: terminal colors depend on the systemJan Edmund Lazo2018-07-29
| | | | | | | | | | | | Problem: Terminal colors depend on the system. Solution: Use the highlight color lookup tables. https://github.com/vim/vim/commit/b41bf8e6b45a773456031954bca1bc4212cbffbe
* | syntax: syn_pattern.sp_syncing is boolJan Edmund Lazo2018-07-30
| |
* | syntax: add const to get_syntax_attr() paramsJan Edmund Lazo2018-07-30
| |
* | syntax: add const to syn_finish_line() params,varsJan Edmund Lazo2018-07-30
| |
* | syntax: did_header is boolJan Edmund Lazo2018-07-29
| | | | | | | | | | | | | | Refactor all affected functions: - add const - declare and initialize on same line - update boolean declarations from int with bool
* | syntax: scl_id is intJan Edmund Lazo2018-07-29
| |
* | syntax: refactor get_id_list()Jan Edmund Lazo2018-07-29
| | | | | | | | | | | | Add const to parameters and variables. Declare and init variables on same line. Use `sizeof(*ptr)` to calculate size for malloc().
* | syntax: refactor syn_combine_list()Jan Edmund Lazo2018-07-29
| | | | | | | | | | | | | | | | | | Add const on parameters and variables. Update declarations to avoid typecasts. Use `sizeof(*ptr)` for malloc() to reduce effect of type changes. ie. short to int16_t Update syn_compare_stub() variable declarations for consistency.
* | syntax: syn_cluster_T.scl_list is int16_t*Jan Edmund Lazo2018-07-29
| |
* | syntax: refactor syn_current_attr()Jan Edmund Lazo2018-07-29
| | | | | | | | | | | | | | Declare and initialize variables on same line if possible. Add const to parameters and variables. Use bool for any parameter,variable using TRUE/FALSE macros. Replace 'short' type with 'int16_t'.
* | syntax: use const on check_keyword_id() variablesJan Edmund Lazo2018-07-29
| | | | | | | | | | Declare and initialize variables as close as possible. Use const pointers without changing semantics if possible.
* | syntax: current_next_list is int16_t*Jan Edmund Lazo2018-07-29
| |
* | syntax: update types of stateitem_T membersJan Edmund Lazo2018-07-29
| | | | | | | | | | Replace 'short' with 'int16_t' to match lint changes from 8.0.1541. Update ID_LIST_ALL to match type of stateitem_T.si_cont_list.
* | syntax: use const on syn_list_keywords() variablesJan Edmund Lazo2018-07-29
| |
* | syntax: use const on copy_id_list() params,varsJan Edmund Lazo2018-07-29
| |
* | syntax: use const on add_keyword() params,varsJan Edmund Lazo2018-07-29
| |
* | syntax: update types of syn_opt_arg_T membersJan Edmund Lazo2018-07-29
| | | | | | | | | | Use bool, not int, for booleans. Use int16_t, not short, to match lint changes from patch 8.0.1541.
* | syntax: use const on put_id_list() variablesJan Edmund Lazo2018-07-29
| |
* | vim-patch:8.0.1541: synpat_T is taking too much memoryJan Edmund Lazo2018-07-29
|/ | | | | | Problem: synpat_T is taking too much memory. Solution: Reorder members to reduce padding. (Dominique Pelle, closes vim/vim#2671) https://github.com/vim/vim/commit/36f923014a7eb7e24c4b0b88719cad14351e3a60
* ui: use line-based rather than char-based updates in screen.cBjörn Linse2018-07-21
| | | | | | | | | | | | | Add ext_newgrid and ext_hlstate extensions. These use predefined highlights and line-segment based updates, for efficiency and simplicity.. The ext_hlstate extension in addition allows semantic identification of builtin and syntax highlights. Reimplement the old char-based updates in the remote UI layer, for compatibility. For the moment, this is still the default. The bulitin TUI uses the new line-based protocol. cmdline uses curwin cursor position when ext_cmdline is active.
* highlight: refactor to use stateful representationBjörn Linse2018-07-21
| | | | | This allows us to keep track of the source higlight groups, and not only the final combined highlights.
* highlight: extract low-level highlight logic from syntax, uiBjörn Linse2018-07-21
|
* startup: fix ":if 0|syntax on|endif" bug (#8731)Justin M. Keyes2018-07-18
| | | | | | | Problem: ":if 0|syntax {on,off}|endif" skips the default of "syntax on" because the executor was setting the `did_syntax_onoff` flag even though "syntax {on,off}" is not actually executed. closes #8728
* vim-patch:8.0.0640: mismatch between help and actual messageJan Edmund Lazo2018-07-03
| | | | | | Problem: Mismatch between help and actual message for ":syn conceal". Solution: Change the message to match the help. (Ken Takata) https://github.com/vim/vim/commit/83064068eaabf75a7d235b0eec561dccbcb96b31
* *: Replace b_changedtick with new always-inline functionsZyX2018-06-22
| | | Ref #8474
* vim-patch:8.0.0616: not always setting 'background' correctly after :hi ↵Jan Edmund Lazo2018-06-21
| | | | | | | | | | | | | | Normal (#8606) Problem: When setting the cterm background with ":hi Normal" the value of 'background' may be set wrongly. Solution: Check that the color is less than 16. Don't set 'background' when it was set explicitly. (Lemonboy, closes vim/vim#1710) https://github.com/vim/vim/commit/1615b36b91b094263240d7b555283ddf33208f62 Restore reset_option_was_set(), removed in 419da839e0cbdf6251bc31dc218fa629ccc91b44 ref #8595 ref #8597
* syntax: refactor syn_finish_line to return boolJan Edmund Lazo2018-06-16
|
* vim-patch:8.0.0481: unnecessary if statementJan Edmund Lazo2018-06-16
| | | | | | | Problem: Unnecessary if statement. Solution: Remove the statement. Fix "it's" vs "its" mistakes. (Dominique Pelle, closes vim/vim#1568) https://github.com/vim/vim/commit/aab93b12cb54fbe5efe9e8f6fde1c46802a3031e
* vim-patch:8.0.0451: some macros are in lower caseJan Edmund Lazo2018-06-12
| | | | | | | Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice. https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f
* vim-patch:8.0.0466: still macros that should be all-caps (#8510)Jan Edmund Lazo2018-06-10
| | | | | Problem: There are still a few macros that should be all-caps. Solution: Make a few more macros all-caps. https://github.com/vim/vim/commit/8820b48654b62472821d9b155fe03ab7ac13a05c
* syntax: Fix PVS/V560: condition was already checkedZyX2018-04-22
|