summaryrefslogtreecommitdiffstats
path: root/src/highlight.c
AgeCommit message (Collapse)Author
2024-04-09patch 9.1.0288: MS-Windows: compiler warning for size_t to int conversionv9.1.0288Mike Williams
Problem: MS-Windows: compiler warning for size_t to int conversion (after v9.1.0282) Solution: Use size_t instead of int in highlight_set_termgui_attr (Mike Williams) closes: #14457 Signed-off-by: Mike Williams <mrmrdubya@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-09patch 9.1.0282: Several small issues in doc and testsv9.1.0283Christian Brabandt
Problem: Wrong doc style for pandoc syntax description, Test_diff_eob_halfpage() may fail depending on screen size, using braces in highlight.c when not necessary Solution: Fix pandoc documentation, make sure the window for the test has 7 lines, remove the braces. Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-08patch 9.1.0282: Finding highlighting attributes is inefficientv9.1.0282John Marriott
Problem: Finding highlighting attributes is inefficient Solution: Use binary search to find highlighting attributes and color names (John Marriott) closes: #14426 Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-14patch 9.1.0106: Visual highlight hard to read with 'termguicolors'v9.1.0106Maxim Kim
Problem: Visual highlight hard to read with 'termguicolors' (Maxim Kim) Solution: Set Visual GUI foreground to black (with background=light) and lightgrey (with background=dark) (Maxim Kim) fixes: #14024 closes: #14025 Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-01patch 9.1.0068: Visual highlighting can still be improvedv9.1.0068Maxim Kim
Problem: Visual highlighting can still be improved Solution: Update Visual highlighting for 8 color terminals, use uniform grey highlighting for dark and light bg (Maxim Kim) Update terminal Visual 1. Use `ctermbg=Grey ctermfg=Black` for both dark and light This uniforms Visual highlighting between default dark and light colors And should work for vim usually detecting light background for terminals with black/dark background colors. Previously used `ctermfg=White` leaks `cterm=bold` if available colors are less than 16. 2. Use `term=reverse cterm=reverse ctermbg=NONE ctermfg=NONE` for terminals reporting less than 8 colors available If the terminal has less than 8 colors, grey just doesn't work right closes: #13940 Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-28patch 9.1.0061: UX of visual highlighting can be improvedv9.1.0061Christian Brabandt
Problem: UX of visual highlighting can be improved Solution: Improve readibility of visual highlighting, by setting better foreground and background colors The default visual highlighting currently is nice in that it overlays the actual syntax highlighting by using a separate distinct background color. However, this can cause hard to read text, because the contrast between the actual syntax element and the background color is way too low. That is an issue, that has been bothering colorschemes authors for quite some time so much, that they are defining the Visual highlighting group to use a separate foreground and background color, so that the syntax highlighting vanishes, but the text remains readable (ref: vim/colorschemes#250) So this is an attempt to perform the same fix for the default Visual highlighting and just use a default foreground and background color instead of using reverse. I also removed the hard-coded changes to the Visual highlighting in init_highlight. It's not quite clear to me, why those were there and not added directly to the highlighting_init_<dark|light> struct. closes: #13663 related: vim/colorschemes#250 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-15patch 9.1.0030: Cannot use terminal alternate fontv9.1.0030PMunch
Problem: Cannot use terminal alternate fonts (PMunch) Solution: Support terminal alternate fonts using CSI SGR 10-20 and t_CF code (PMunch) Add support for alternate font highlighting This adds support for alternate font highlighting using CSI SGR 10-20. Few terminals currently support this, but with added tool support this should improve over time. The change here is more or less taken from how colors are configured and applied, but there might be some parts I missed while implementing it. Changing fonts is done through the new `:hi ctermfont` attribute which takes a number, 0 is the normal font, and the numbers 1-9 select an "alternative" font. Which fonts are in use is up to the terminal. fixes: #13513 closes: #13537 Signed-off-by: PMunch <peterme@peterme.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-04patch 9.1.0006: is*() and to*() function may be unsafev9.1.0006Keith Thompson
Problem: is*() and to*() function may be unsafe Solution: Add SAFE_* macros and start using those instead (Keith Thompson) Use SAFE_() macros for is*() and to*() functions The standard is*() and to*() functions declared in <ctype.h> have undefined behavior for negative arguments other than EOF. If plain char is signed, passing an unchecked value from argv for from user input to one of these functions has undefined behavior. Solution: Add SAFE_*() macros that cast the argument to unsigned char. Most implementations behave sanely for negative arguments, and most character values in practice are non-negative, but it's still best to avoid undefined behavior. The change from #13347 has been omitted, as this has already been separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a (v9.0.2054) fixes: #13332 closes: #13347 Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-29patch 9.0.1958: cannot complete option valuesv9.0.1958Yee Cheng Chin
Problem: cannot complete option values Solution: Add completion functions for several options Add cmdline tab-completion for setting string options Add tab-completion for setting string options on the cmdline using `:set=` (along with `:set+=` and `:set-=`). The existing tab completion for setting options currently only works when nothing is typed yet, and it only fills in with the existing value, e.g. when the user does `:set diffopt=<Tab>` it will be completed to `set diffopt=internal,filler,closeoff` and nothing else. This isn't too useful as a user usually wants auto-complete to suggest all the possible values, such as 'iblank', or 'algorithm:patience'. For set= and set+=, this adds a new optional callback function for each option that can be invoked when doing completion. This allows for each option to have control over how completion works. For example, in 'diffopt', it will suggest the default enumeration, but if `algorithm:` is selected, it will further suggest different algorithm types like 'meyers' and 'patience'. When using set=, the existing option value will be filled in as the first choice to preserve the existing behavior. When using set+= this won't happen as it doesn't make sense. For flag list options (e.g. 'mouse' and 'guioptions'), completion will take into account existing typed values (and in the case of set+=, the existing option value) to make sure it doesn't suggest duplicates. For set-=, there is a new `ExpandSettingSubtract` function which will handle flag list and comma-separated options smartly, by only suggesting values that currently exist in the option. Note that Vim has some existing code that adds special handling for 'filetype', 'syntax', and misc dir options like 'backupdir'. This change preserves them as they already work, instead of converting to the new callback API for each option. closes: #13182 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-08-20patch 9.0.1767: '.-' no allowed in highlight group namesv9.0.1767Gregory Anders
Problem: '.-' no allowed in highlight group names Solution: Allow dot and hyphen characters in highlight group names Allow dots and hyphens in group names. There does not seem to be any reason for these to be disallowed. closes: #12807 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-03-10patch 9.0.1397: highlight for popupmenu kind and extra cannot be setv9.0.1397Gianmaria Bajo
Problem: Highlight for popupmenu kind and extra cannot be set. Solution: Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel highlight groups and use them. (Gianmaria Bajo, closes #12114)
2023-02-21patch 9.0.1336: functions without arguments are not always declared properlyv9.0.1336Yegappan Lakshmanan
Problem: Functions without arguments are not always declared properly. Solution: Use "(void)" instead of "()". (Yegappan Lakshmanan, closes #12031)
2023-01-09patch 9.0.1166: code is indented more than necessaryv9.0.1166Yegappan Lakshmanan
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
2023-01-02patch 9.0.1133: error message names do not match the itemsv9.0.1133Bram Moolenaar
Problem: Error message names do not match the items. Solution: Add "_str" when the text contains "%s".
2022-11-02patch 9.0.0828: various typosv9.0.0828dundargoc
Problem: Various typos. Solution: Correct typos. (closes #11432)
2022-09-03patch 9.0.0364: clang static analyzer gives warningsv9.0.0364Yegappan Lakshmanan
Problem: Clang static analyzer gives warnings. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #11043)
2022-08-31patch 9.0.0343: ColorScheme autocommand triggered when colorscheme not foundv9.0.0343Bram Moolenaar
Problem: ColorScheme autocommand triggered when colorscheme is not found. (Romain Lafourcade) Solution: Only trigger ColorScheme when loading the colorscheme succeeds. (closes #11024)
2022-08-31patch 9.0.0340: the 'cmdheight' zero support causes too much troublev9.0.0340Bram Moolenaar
Problem: The 'cmdheight' zero support causes too much trouble. Solution: Revert support for 'cmdheight' being zero.
2022-08-30patch 9.0.0329: ":highlight" hangs when 'cmdheight' is zerov9.0.0329Bram Moolenaar
Problem: ":highlight" hangs when 'cmdheight' is zero. Solution: Add to msg_col when using the message window. (closes #11014)
2022-08-26patch 9.0.0279: the tiny version has the popup menu but not 'wildmenu'v9.0.0279Bram Moolenaar
Problem: The tiny version has the popup menu but not 'wildmenu'. Solution: Graduate the wildmenu feature.
2022-08-22patch 9.0.0245: mechanism to prevent recursive screen updating is incompletev9.0.0245Bram Moolenaar
Problem: Mechanism to prevent recursive screen updating is incomplete. Solution: Add "redraw_not_allowed" and set it in build_stl_str_hl(). (issue #10952)
2022-08-14patch 9.0.0206: redraw flags are not named specificallyv9.0.0206Bram Moolenaar
Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen().
2022-08-13patch 9.0.0203: confusing variable namev9.0.0203Bram Moolenaar
Problem: Confusing variable name. Solution: Use "prim_aep" instead of "spell_aep".
2022-08-10patch 9.0.0189: invalid memory access for text prop without highlightv9.0.0189Bram Moolenaar
Problem: Invalid memory access for text prop without highlight. Solution: Check for a valid highlight ID.
2022-07-23patch 9.0.0063: too many type casts for dict_get functionsv9.0.0063Bram Moolenaar
Problem: Too many type casts for dict_get functions. Solution: Change the key argument from "char_u *" to "char *".
2022-06-29patch 9.0.0007: no support for double, dotted and dashed underlinesv9.0.0007Bram Moolenaar
Problem: No support for double, dotted and dashed underlines. Solution: Add the termcap entries and highlight modes. (closes #9553)
2022-06-29patch 9.0.0003: functions are global while they could be localv9.0.0003Yegappan Lakshmanan
Problem: Functions are global while they could be local. Solution: Add "static". Add a few tests. (Yegappan Lakshmanan, closes #10612)
2022-05-09patch 8.2.4928: various white space and cosmetic mistakesv8.2.4928Bram Moolenaar
Problem: Various white space and cosmetic mistakes. Solution: Change spaces to tabs, improve comments.
2022-05-05patch 8.2.4877: MS-Windows: Wrongly using Normal colors for termguicolorsv8.2.4877Christian Brabandt
Problem: MS-Windows: Using Normal colors for termguicolors causes problems. Solution: Do not use Normal colors to set sg_gui_fg and sg_gui_bg. (Christian Brabandt, closes #10317, closes #10241)
2022-05-02patch 8.2.4858: K_SPECIAL may be escaped twicev8.2.4858zeertzjq
Problem: K_SPECIAL may be escaped twice. Solution: Avoid double escaping. (closes #10340)
2022-04-15patch 8.2.4753: error from setting an option is silently ignoredv8.2.4753Bram Moolenaar
Problem: Error from setting an option is silently ignored. Solution: Handle option value errors better. Fix uses of N_().
2022-04-09patch 8.2.4724: current instance of last search pattern not easily spottedv8.2.4724LemonBoy
Problem: Current instance of last search pattern not easily spotted. Solution: Add CurSearch highlighting. (closes #10133)
2022-04-04patch 8.2.4683: verbose check with dict_find() to see if a key is presentv8.2.4683Yegappan Lakshmanan
Problem: Verbose check with dict_find() to see if a key is present. Solution: Add dict_has_key(). (Yegappan Lakshmanan, closes #10074)
2022-02-16patch 8.2.4402: missing parenthesis may cause unexpected problemsv8.2.4402kylo252
Problem: Missing parenthesis may cause unexpected problems. Solution: Add more parenthesis is macros. (closes #9788)
2022-01-08patch 8.2.4045: some global functions are only used in one filev8.2.4045Yegappan Lakshmanan
Problem: Some global functions are only used in one file. Solution: Make the functions static. (Yegappan Lakshmanan, closes #9492)
2022-01-08patch 8.2.4038: various code not used when features are disabledv8.2.4038Dominique Pelle
Problem: Various code not used when features are disabled. Solution: Add #ifdefs. (Dominique Pellé, closes #9491)
2022-01-05patch 8.2.4010: error messages are spread outv8.2.4010Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2022-01-04patch 8.2.4005: error messages are spread outv8.2.4005Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2022-01-02patch 8.2.3986: error messages are spread outv8.2.3986Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2022-01-02patch 8.2.3985: error messages are spread outv8.2.3985Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2022-01-01patch 8.2.3967: error messages are spread outv8.2.3967Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-31patch 8.2.3961: error messages are spread outv8.2.3961Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-07patch 8.2.3757: an overlong highlight group name is silently truncatedv8.2.3757erw7
Problem: An overlong highlight group name is silently truncated. Solution: Give an error if the name is too long. (closes #9289)
2021-11-24patch 8.2.3668: messages may be corruptedv8.2.3668Yegappan Lakshmanan
Problem: Messages may be corrupted. Solution: Use another buffer instead of IObuff. (Yegappan Lakshmanan, closes #9195)
2021-11-24patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'v8.2.3664Bram Moolenaar
Problem: Cannot adjust sign highlighting for 'cursorline'. Solution: Add CursorLineSign and CursorLineFold highlight groups. (Gregory Anders, closes #9201)
2021-11-20patch 8.2.3628: looking terminal colors is a bit slowv8.2.3628Bram Moolenaar
Problem: Looking terminal colors is a bit slow. Solution: Cache the terminal colors. (closes #9130, closes #9058)
2021-11-16patch 8.2.3605: cannot clear and unlinke a highlight group with hlset()v8.2.3605Yegappan Lakshmanan
Problem: Cannot clear and unlinke a highlight group with hlset() in a single call. Solution: Add the "force" option. (Yegappan Lakshmanan, closes #9117)
2021-11-13patch 8.2.3590: test for v:colornames sometimes failsv8.2.3590Drew Vogel
Problem: Test for v:colornames sometimes fails. (Dominique Pellé) Solution: Check features. Clear v:colornames between tests. (Drew Vogel, closes #9105, closes #9073)
2021-11-03patch 8.2.3578: manipulating highlighting is complicatedv8.2.3578Yegappan Lakshmanan
Problem: Manipulating highlighting is complicated. Solution: Add the hlget() and hlset() functions. (Yegappan Lakshmanan, closes #9039)
2021-10-25patch 8.2.3563: build failure with +eval but without GUI or +termguicolorsv8.2.3563Bram Moolenaar
Problem: Build failure with +eval but without GUI or +termguicolors Solution: Adjust #ifdef. (John Marriott)