98 Commits

Author SHA1 Message Date
Ingo Karkat a75208678b Merge branch 'release/1.12' into stable 1.12 2022-11-01 09:05:05 +01:00
Ingo Karkat 8b7e3b628d Release 1.12 2022-11-01 09:02:03 +01:00
Ingo Karkat 26e5b59a3c diff filetype: Exclude patch instructions that just consist of # + single space 2022-01-15 18:06:36 +01:00
Ingo Karkat 66beaf216c Adapt: Directly use ingo-library functions
Now that we have a hard dependency, anyway. Remove the fallback implementations, and inline s:IsPersistedBuffer().
2021-06-09 08:14:54 +02:00
Ingo Karkat 2b4f8f4ebf Reorg: Move s:GetColorModes() into ingo-library
As ingo#hlgroup#GetApplicableColorModes().
2021-06-09 08:12:01 +02:00
Ingo Karkat 62cee68ef9 Color: Reuse Get{Fore,Back]groundColor() from ingo-library
Now that we have a hard dependency on it, anyway.
2021-06-09 08:06:40 +02:00
Ingo Karkat 386b75ad61 s:DetectAll(): Replace :windo with ingo#window#iterate#All() 2021-06-09 07:53:56 +02:00
Ingo Karkat 9f5ac750f5 Merge tag '1.11'
Version 1.11
2020-12-21 08:41:58 +01:00
Ingo Karkat bf6b72aba9 Merge branch 'release/1.11' into stable 1.11 2020-12-21 08:41:48 +01:00
Ingo Karkat ad11532a8d Release 1.11 2020-12-21 08:39:59 +01:00
Ingo Karkat 73969f24e2 Comments: Add note about ingo-library function availability 2020-12-21 08:37:07 +01:00
Ingo Karkat 79c57933a6 ENH: Inspect and automatically adapt the linked highlight group if it doesn't have a background color
Merge branch 'feature/auto-background-color'
2020-12-20 12:10:33 +01:00
Ingo Karkat 7a6ac4398c Documentation: Mention Neovim patch 2020-12-20 12:10:14 +01:00
Ingo Karkat a12144ae80 FIX: Subsequent automatic background adaptations only work in recent Vim and :hi def link
Vim 8.2.2034 somehow restores a :hi def link after a colorscheme change, so the override of the adapted ShowTrailingWhitespace highlight group is automatically undone. But this does not happen in Vim 7.4.1689 and also not with :hi link (what a customization would use), so it cannot be relied on.
Instead, check for a linked highlight group only once on plugin startup and store a linked ID in g:ShowTrailingWhitespace_LinkedSyntaxId.
ShowTrailingWhitespace#Color#EnsureVisibleBackgroundColor() then reuses that original ID. It also sets a s:didAutomaticBackground flag if it had modified the ShowTrailingWhitespace highlight group, and restores the link if for a changed colorscheme this adaptation is no longer necessary.
2020-12-20 11:08:07 +01:00
Subhaditya Nath da39ee9c51 Compatibility: Neovim doesn't have gui_running
Neither has('gui_running') nor has('gui') return 1 in Neovim, even if a
gui is running.
2020-12-20 10:06:01 +01:00
Ingo Karkat d399223830 Documentation: Update changelog 2020-12-19 22:35:15 +01:00
Ingo Karkat 51c33feeff Allow to disable the new logic via g:ShowTrailingWhitespace_IsAutomaticBackground configuration flag 2020-12-19 22:31:11 +01:00
Ingo Karkat bcc0c109d0 ENH: Check whether a linked highlight group has a background color, and use foreground color instead if not
The plugin links to the existing Error highlight group, assuming that this employs a (often red) background color. Some colorschemes (e.g. "koehler") only define a foreground color, though. That is of no use for the plugin's use case, though, because the trailing whitespace has no foreground, so only a background color can be used here. (Well, with :set list and 'listchars' having a "space" or "trail" setting, there would be some foreground to highlight, but it would be flimsy and the setting usually is off.)
To address this issue, we need to build in some intelligence: If the ShowTrailingWhitespace highlight group is not linked to another, the user has defined their own colors, and we expect them to know what they're doing. If it is linked, check for the existence of a background color (considering the "reverse" attribute, and that the background color may be equal to the default background, but explicitly set). If there's no effective background coloring, fall back to using the foreground color instead.
2020-12-19 22:18:10 +01:00
Ingo Karkat 3cfd997a4a Refactoring: Redefine s:HlGroupName as autoload variable and use in the :hi def link command as well 2020-12-19 19:05:38 +01:00
Ingo Karkat 44d0e795fb Cosmetics: Add missing scope, forgotten restore of &cpo 2020-12-19 19:01:15 +01:00
Ingo Karkat 40eabd2621 Exempt the "xxd" filetype used e.g. by the Hexman plugin (vimscript #666) 2020-12-19 15:33:28 +01:00
subnut 2b794708a0 Compatibility: Neovim does not have the TerminalOpen event
In neovim, has('patch1596') returns true, but there is no TerminalOpen event. So, it shows an error everytime neovim is launched. This commit aims to fix that

Closes #3
2020-07-13 15:08:45 +02:00
Ingo Karkat eed332f25c Merge tag '1.10'
Version 1.10
2020-07-11 19:57:09 +02:00
Ingo Karkat cbc616f84b Merge branch 'release/1.10' into stable 1.10 2020-07-11 19:56:56 +02:00
Ingo Karkat a4eac0f60e Cosmetics: Simplify dependencies, remove changelogs from ftplugin scripts 2020-07-11 19:54:26 +02:00
Ingo Karkat 19886c012c Documentation: Release 1.10 2020-07-11 19:52:14 +02:00
Ingo Karkat 1097fbc3a4 Documentation: Add snippet to disable plugin for a filetype, and add introductory paragraph for filtering approaches
Closes #2
2020-07-11 19:49:54 +02:00
Ingo Karkat 310a26820e Housekeeping: Add GitHub issue templates 2020-06-17 21:51:24 +02:00
Ingo Karkat 72174fd591 FIX: Avoid creating jump when enabling / setting a local extra pattern 2019-02-22 22:12:45 +01:00
Ingo Karkat 78220a2e0a Minor: Use bufname('') for unnamed buffer check
ingo#fs#path#Canonicalize() returns the absolute path to the directory, with is inconsistent with expand('%:p'). For consistency, always check the buffer name.
2019-02-05 14:53:07 +01:00
Ingo Karkat 1e235a1f43 ENH: Make the default filter also consider session-local and persistent blacklists for files where highlighting should be off
Offer public functions to implement custom commands or mappings for blacklist management.
Document optional dependency to ingo-library, add s:GetFilespec() compatibility shim, and use ingo#buffer#IsPersisted() if we have it.
2019-02-04 17:03:20 +01:00
Ingo Karkat 5afb9081e1 Cosmetics: Delete changelogs 2018-12-15 21:55:54 +01:00
Ingo Karkat b7a6fa7999 Workaround: Terminal windows are highlighted, even though 'buftype' is set
But too late; the terminal buffer is first created as a normal empty buffer ([No Name], with empty 'buftype'). Only later :setlocal buftype=terminal happens (and the OptionSet event also isn't triggered for it, so we cannot use that to hook into). Fortunately, a separate TerminalOpen event was created.
As the default filter is defined in a separate autoload script, we can simply define the autocmd during sourcing of the script.
2018-12-15 21:51:25 +01:00
Ingo Karkat 69e32349d7 Add Readme and gitignore 2018-12-15 20:51:03 +01:00
Ingo Karkat 7834ad9476 Move functions to autoload script 2018-12-15 20:39:47 +01:00
Ingo Karkat ea3c703722 2018-12-15 20:39:47 +01:00
Ingo Karkat 1319c65a8d ENH: Keep previous (last accessed) window on :windo 2018-12-15 20:39:44 +01:00
Ingo Karkat 5b345a84f3 Also exclude quickfix and help buffers from detection 2018-12-15 20:39:42 +01:00
Ingo Karkat d98d92b86a file creation 2018-12-15 20:39:42 +01:00
Ingo Karkat f7db5aa61a 2018-12-15 20:39:42 +01:00
Ingo Karkat e420dc4247 2018-12-15 20:39:42 +01:00
Ingo Karkat 0b0e4ce56c 2018-12-15 20:39:42 +01:00
Ingo Karkat f206a9ca52 file creation 2018-12-15 20:39:42 +01:00
Ingo Karkat a197e59989 2018-12-15 20:39:41 +01:00
Ingo Karkat cab8c7bdd2 Documentation: Update changelog
- Exempt the "unite" filetype used by the Unite plugin (vimscript #3396).
  Thanks to Fernando "Firef0x" G.P. da Silva for the patch.
2018-12-15 20:39:39 +01:00
Ingo Karkat 7b790e47cc 2018-12-15 20:39:39 +01:00
Ingo Karkat f1b7477489 2018-12-15 20:39:39 +01:00
Ingo Karkat dc43067b9f Documentation: ENH: Keep previous (last accessed) window on :windo 2018-12-15 20:39:34 +01:00
Ingo Karkat cdd48f3c3c Documentation: Update changelog
- Make ShowTrailingWhitespace#IsSet() also handle Vim 7.0/1 where the
  g:ShowTrailingWhitespace variable is not set. Return 0 instead of causing a
  function abort.
2018-12-15 20:39:31 +01:00
Ingo Karkat 325ab10f01 Make ShowTrailingWhitespace#IsSet() also handle Vim 7.0/1 where the g:ShowTrailingWhitespace variable is not set
Return 0 instead of causing a function abort.
2018-12-15 20:39:27 +01:00