aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
Commit message (Collapse)AuthorAge
* vim-patch:8.2.0865 syntax: Add command to control how foldlevel is computedBrad King2020-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Syntax foldlevel is taken from the start of the line. Solution: Add ":syn foldlevel" to be able to use the minimal foldlevel in the line. https://github.com/vim/vim/commit/e35a52aee718c881bdfa69a47a1068df6ab6c60a With `foldmethod=syntax` the foldlevel of a line is computed based on syntax items on the line. Previously we always used the level of the syntax item containing the start of the line. This works well in cases such as: if (...) { ... } else if (...) { ... } else { ... } which folds like this: +--- 3 lines: if (...) {--------------------------- +--- 3 lines: else if (...) {---------------------- +--- 3 lines: else {------------------------------- However, the code: if (...) { ... } else if (...) { ... } else { ... } folds like this: +--- 7 lines: if (...) {--------------------------- We can make the latter case fold like this: +--- 2 lines: if (...) {--------------------------- +--- 2 lines: } else if (...) {-------------------- +--- 3 lines: } else {----------------------------- by choosing on each line the lowest fold level that is followed by a higher fold level. Add a syntax command :syntax foldlevel [start | minimum] to choose between these two methods of computing the foldlevel of a line.
* syntax: Factor out duplicate E390 stringsBrad King2020-06-23
|
* syntax: factor out helper to compute the syntax-based foldlevelBrad King2020-06-23
|
* vim-patch:8.1.1895: using NULL pointer when out of memoryJan Edmund Lazo2020-06-04
| | | | | | | Problem: Using NULL pointer when out of memory. Solution: Bail out or skip the code using the pointer. (Zu-Ming Jiang, closes vim/vim#4805, closes vim/vim#4843, closes vim/vim#4939, closes vim/vim#4844) https://github.com/vim/vim/commit/6f10c70b59fa4e56aa479345fb0caeaac7429bfb
* vim-patch:8.2.0635: when using 256 colors DarkYellow does not show expected ↵Jan Edmund Lazo2020-04-25
| | | | | | | | color Problem: When using 256 colors DarkYellow does not show expected color. Solution: Use color 3 instead of 130. (Romain Lafourcade, closes vim/vim#5985) https://github.com/vim/vim/commit/e93c968f520ee8d6bc29ccc6e18055ac65e832b3
* doc: fix typos [ci skip] #11787Hye Sung Jung2020-01-30
|
* vim-patch:8.1.1308: the Normal highlight is not defined when compiled with GUIJan Edmund Lazo2020-01-06
| | | | | | Problem: The Normal highlight is not defined when compiled with GUI. Solution: Always define Normal. (Christian Brabandt, closes vim/vim#4072) https://github.com/vim/vim/commit/f90b6e03a983b62b66564fc449e32724d6456769
* doc: fix typosBrian Wignall2019-11-27
| | | | close #11459
* syntax: zero-init local structsJan Edmund Lazo2019-11-02
| | | | Fix https://neovim.io/doc/reports/clang/report-ee5dbd.html#EndPath
* vim-patch:8.0.0914: highlight attributes are always combined (#10256)Daniel Hahler2019-09-26
| | | | | | | | | Problem: Highlight attributes are always combined. Solution: Add the 'nocombine' value to replace attributes instead of combining them. (scauligi, closes vim/vim#1963) https://github.com/vim/vim/commit/0cd2a94a4030f6bd12eaec44db92db108e33c913 Closes https://github.com/neovim/neovim/pull/10256.
* vim-patch:8.0.1621: using invalid default value for highlight attributeJan Edmund Lazo2019-09-21
| | | | | | Problem: Using invalid default value for highlight attribute. Solution: Use zero instead of -1. https://github.com/vim/vim/commit/6185903e3d07eb53326fc1403fc2de97ca31b775
* vim-patch:8.0.1134: superfluous call to syn_get_final_id()Jan Edmund Lazo2019-09-14
| | | | | | Problem: Superfluous call to syn_get_final_id(). Solution: Remove it. (Ken Takata) https://github.com/vim/vim/commit/76301956f0c079d893cfd927b11456328bed4f9b
* lintJustin M. Keyes2019-09-13
|
* getdigits: introduce `strict`, `def` parametersJustin M. Keyes2019-09-13
| | | | | | | | | | | | Problem: During a refactor long ago, we changed the `getdigits_*` familiy of functions to abort on overflow. But this is often wrong, because many of these codepaths are handling user input. Solution: Decide at each call-site whether to use "strict" mode. fix #5555
* syntax, TUI: support "strikethrough"Jaskaran Singh2019-09-13
| | | | | | fix #3436 Includes: vim-patch:8.0.1038: strike-through text not supported
* vim-patch:8.0.0941: existing color schemes don't like StatusLineTermJan Edmund Lazo2019-09-09
| | | | | | | Problem: Existing color schemes don't work well with StatusLineTerm. Solution: Don't use "reverse", use fg and bg colors. Also add StatusLineTermNC. https://github.com/vim/vim/commit/05fbfdcda48a564e7a778c67251f732481f3ceaa
* vim-patch:8.0.0937: user highlight groups not adjusted for terminalJan Edmund Lazo2019-09-09
| | | | | | Problem: User highlight groups are not adjusted for StatusLineTerm. Solution: Combine attributes like for StatusLineNC. https://github.com/vim/vim/commit/bce4f62d3043f04fe29f3fef2b927b2268b15255
* vim-patch:8.0.0970: passing invalid highlight id #10972Justin M. Keyes2019-09-08
| | | | | | | | | (We don't implement StatusLineTerm{NC}, but this patch seems generally relevant.) Problem: if there is no StatusLine highlighting and there is StatusLineNC or StatusLineTermNC highlighting then an invalid highlight id is passed to combine_stl_hlt(). (Coverity) Solution: Check id_S to be -1 instead of zero. https://github.com/vim/vim/commit/d6a7b3e6bbb8f87507de68d86cf70eab806aab3a
* vim-patch:8.0.1332: enhance quickfix highlighting #10259Daniel Hahler2019-09-06
| | | | | | | | Problem: Highlighting in quickfix window could be better. (Axel Bender) Solution: Use the qfSeparator highlight item. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/93a32e2ec4b5a391c5006ca09f196e6510c8c2e9 This adds `syn_name2attr` already (from previous patch 8.0.1123, vim/vim@1b9645de3).
* vim-patch:8.1.0362: cannot get the script line number when executing a functionerw72019-09-04
| | | | | | | Problem: Cannot get the script line number when executing a function. Solution: Store the line number besides the script ID. (Ozaki Kiichi, closes vim/vim#3362) Also display the line number with ":verbose set". https://github.com/vim/vim/commit/f29c1c6aa3f365c025890fab5fb9efbe88eb1761
* screen: use dedicated message gridBjörn Linse2019-09-01
| | | | | | | | add proper msg_set_pos event, delet win_scroll_over_* make compositor click through unfocusable grids add MsgArea attribute for the message/cmdline area, and add docs and tests
* vim-patch:8.1.1950: using NULL pointer after an out-of-memory (#10902)Jan Edmund Lazo2019-08-31
| | | | | Problem: Using NULL pointer after an out-of-memory. Solution: Check for NULL pointer. (Dominique Pelle, closes vim/vim#4881) https://github.com/vim/vim/commit/4bbfb0f3cc67c00c8cee4e47283e8d760025219d
* Merge #10368 from janlazo/vim-8.0.1164Justin M. Keyes2019-07-19
|\ | | | | vim-patch:8.0.{755,1146,1164}
| * vim-patch:8.0.1164: changing StatusLine highlight does not always workJan Edmund Lazo2019-07-06
| | | | | | | | | | | | | | | | Problem: Changing StatusLine highlight while evaluating 'statusline' may not change the status line color. Solution: When changing highlighting while redrawing don't cause another redraw. (suggested by Ozaki Kiichi, closes vim/vim#2171, closes vim/vim#2120) https://github.com/vim/vim/commit/65ed136844fbaffdd473903ed841c944600234dc
| * vim-patch:8.0.1146: redraw when highlight is set with same namesJan Edmund Lazo2019-07-06
| | | | | | | | | | | | Problem: Redraw when highlight is set with same names. (Ozaki Kiichi) Solution: Only free and save a name when it changed. (closes vim/vim#2120) https://github.com/vim/vim/commit/452030e530aad9b08fcfa71737d098b33c752b85
| * vim-patch:8.0.0755: terminal window does not have colors in the GUIJan Edmund Lazo2019-07-06
| | | | | | | | | | | | Problem: Terminal window does not have colors in the GUI. Solution: Lookup the GUI color. https://github.com/vim/vim/commit/26af85d97ba1ed0ade6cdd41890ca04ed879b9c7
* | Merge #10391 from janlazo/vim-8.1.0495Justin M. Keyes2019-07-16
|\ \ | | | | | | vim-patch:8.1.{495,505,531,533,583,623,630,641,686,715,833,1012,1221,1651}
| * | vim-patch:8.1.0495: :filter only supports some commandsJan Edmund Lazo2019-07-15
| | | | | | | | | | | | | | | | | | | | | Problem: :filter only supports some commands. Solution: Add :filter support for more commands. (Marcin Szamotulski, closes vim/vim#2856) https://github.com/vim/vim/commit/f86db78fed78541cefdb706e4779ce5ae9ca7820
* | | Merge pull request #10504 from bfredl/hl_defBjörn Linse2019-07-16
|\ \ \ | |/ / |/| | highlight: expose builtin highlight groups using hl_group_set event
| * | highlight: expose builtin highlight groups using hl_group_set eventBjörn Linse2019-07-14
| | |
* | | syntax: refactor syn_list_header to not use magic valueBjörn Linse2019-07-14
| | |
* | | syntax: fix missing newlines in execute("syn list"). fixes #10467Björn Linse2019-07-14
|/ /
* / ui: add 'redrawdebug' option for flexible debugging of redrawingBjörn Linse2019-07-09
|/
* highlight: show "hi Group" message correctly when not using the screenBjörn Linse2019-07-05
| | | | | | | ext_message doesn't set msg_col. Add a space and let client deal with wrapping. When using silent redirect show the unwrapped message form. Removed check is already part of msg_advance()
* ui: add 'winblend' to support blending of floating windowsBjörn Linse2019-06-25
| | | | Also add `hi blend=` attribute to override transparency of indiviual attributes.
* vim-patch:8.1.0198: there is no hint that syntax is disabled for 'redrawtime'Jan Edmund Lazo2019-06-24
| | | | | | Problem: There is no hint that syntax is disabled for 'redrawtime'. Solution: Add a message. https://github.com/vim/vim/commit/0a6efcd27d62935c465b4406c0c0db9be10a0ddb
* vim-patch:8.1.0437: may access freed memory when syntax HL times outJan Edmund Lazo2019-06-24
| | | | | | Problem: May access freed memory when syntax HL times out. (Philipp Gesang) Solution: Clear b_sst_first when clearing b_sst_array. https://github.com/vim/vim/commit/95892c27b242cdbc78e622c7a861a4e15aec7a30
* vim-patch:8.1.0673: functionality for signs is spread out over several filesAndrej Zieger2019-05-26
| | | | | | | Problem: Functionality for signs is spread out over several files. Solution: Move most of the sign functionality into sign.c. (Yegappan Lakshmanan, closes vim/vim#3751) https://github.com/vim/vim/commit/bbea47075cc4e7826e9f8c203e4272ba023ed7b0
* lintJustin M. Keyes2019-05-25
|
* vim-patch:8.0.1496: VIM_CLEAR()Justin M. Keyes2019-05-25
| | | | | | | | Problem: Clearing a pointer takes two lines. Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi, closes #2629) vim-patch:8.0.1481
* vim-patch:8.1.1209: clever compiler warns for buffer being too smallJan Edmund Lazo2019-04-27
| | | | | | Problem: Clever compiler warns for buffer being too small. Solution: Make the buffer bigger (even though it's not really needed). https://github.com/vim/vim/commit/5431589d25e73892fcf7ad1eaca53f742c1c9303
* vim-patch:8.0.1133: syntax timeout not used correctlyJan Edmund Lazo2019-04-23
| | | | | | | Problem: Syntax timeout not used correctly. Solution: Do not pass the timeout to syntax_start() but set it explicitly. (Yasuhiro Matsumoto, closes vim/vim#2139) https://github.com/vim/vim/commit/f3d769a585040ac47f7054057758809024ef6377
* lintJan Edmund Lazo2019-04-23
|
* vim-patch:8.0.0647: syntax highlighting can make cause a freezeJan Edmund Lazo2019-04-23
| | | | | | Problem: Syntax highlighting can make cause a freeze. Solution: Apply 'redrawtime' to syntax highlighting, per window. https://github.com/vim/vim/commit/06f1ed2f78c5c03af95054fc3a8665df39dec362
* floats: add NormalFloat highlight and 'nonumber' defaultBjörn Linse2019-03-12
|
* vim-patch:8.0.0643: when a pattern search is slow Vim becomes unusableBilly Su2019-03-07
| | | | | | | | | Problem: When 'hlsearch' is set and matching with the last search pattern is very slow, Vim becomes unusable. Cannot quit search by pressing CTRL-C. Solution: When the search times out set a flag and don't try again. Check for timeout and CTRL-C in NFA loop that adds states. https://github.com/vim/vim/commit/fbd0b0af6800f6ff89857863d6a07ea03f09ff6c
* rename ui_is_external to ui_has (#9576)Justin M. Keyes2019-02-03
|
* 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