119 Commits

Author SHA1 Message Date
Christian
4b02724d0c
highglighter: Vim9 script correctly convert hex string to number 2020-11-27 10:43:54 +01:00
Christian
2083bfe890
highlighter: correctly get the colors from global palette for Vim9 2020-11-27 10:43:54 +01:00
Christian
084dfe017d
highlighter: cast Vim9 variables to correct type 2020-11-27 10:43:54 +01:00
Christian
b4e38be8b8
highlighter: fix indentation (tabs) 2020-11-27 10:43:47 +01:00
Christian
0d0c380940
highlighter: fix a couple of vim9script errors and fix indentation 2020-11-27 10:40:38 +01:00
Christian
9f7557df44
highlighter: remove ! from :def in vim9script 2020-11-27 10:40:38 +01:00
Christian
f5e2f97003
highlighter: vim9 script implementation of #highlight() 2020-11-27 10:40:38 +01:00
Christian
14fd943dc6
highlighter: vim9 script implementation of highlight_modified_inactive 2020-11-27 10:40:37 +01:00
Christian
e9d4ff75da
highlighter: vim9 script implementation of add_accent 2020-11-27 10:40:37 +01:00
Christian
9b32ed3229
highlighter: remove ! from :def in vim9script 2020-11-27 10:40:37 +01:00
Christian
58b2a8bbc8
highlighter: add foldmarker at final endif 2020-11-27 10:40:37 +01:00
Christian
5ac55ea4e5
highlighter: vim9 script implementation of add_separator 2020-11-27 10:40:37 +01:00
Christian
56ba4b34a7
highlighter: vim9 fix duplicate variable name in s:exec_separator function 2020-11-27 10:40:37 +01:00
Christian
798a346a91
highlighter: vim9 script implementation of load_theme 2020-11-27 10:40:36 +01:00
Christian
4f8675434a
highlighter: get rid of superflous l: var prefix 2020-11-27 10:40:36 +01:00
Christian
5391b3e246
highlighter: vim9 script implementation of s:exec_separator 2020-11-27 10:40:36 +01:00
Christian
7310ca6cbf
highlighter: run ex command with leading colon in vim9 function #exec 2020-11-27 10:40:36 +01:00
Christian
9ae38b43e4
highlighter: vim9 script implementation of s:GetHiCmd 2020-11-27 10:40:36 +01:00
Christian
2441084898
highlighter: vim9 script implementation of s:CheckDefined 2020-11-27 10:40:36 +01:00
Christian
d9947beb0f
highlighter: vim9 script implementation of #exec 2020-11-27 10:40:36 +01:00
Christian
a6b7267979
highlighter: vim9 script implementation of s:hl_group_exists 2020-11-27 10:40:35 +01:00
Christian
90de76359f
highlighter: use synIDtrans() in s:hl_group_exists (legacy vimscript)
When checking the defined foreground color in the function that checks
whether a highlighting group exists, it should follow the syntax group
links and check the final color.
2020-11-27 10:40:35 +01:00
Christian
0238d386bb
highlighter: vim9 script implementation of get_highlight2 2020-11-27 10:40:35 +01:00
Christian
19861861fd
highlighter: vim9 script implementation of get_highlight 2020-11-27 10:40:35 +01:00
Christian
687fb52d9f
fix indentation of legacy vimscript (remove tabs) 2020-11-27 10:40:35 +01:00
Christian
aa8bd171f3
highlighter: vim9 script implementation of reset_hlcache 2020-11-27 10:40:35 +01:00
Christian
b152059a98
highlighter: vim9 script implementation of s:get_array 2020-11-27 10:40:34 +01:00
Christian
4d75c9940c
highlighter: vim9 script implementation of s:get_syn 2020-11-27 10:40:34 +01:00
Christian
ae3af85ca2
highlighter: remove a couple of empty lines in legacy vimscript implementation 2020-11-27 10:40:34 +01:00
Christian
a9f525f8da
highlighter: vim9 script implementation of s:group_not_done 2020-11-27 10:40:34 +01:00
Christian
3e93c212cc
highlighter: vim9 script implementation of s:gui2cui 2020-11-27 10:40:34 +01:00
Christian
a8afa434e3
highlighter: Add condition for new vim9 script implementation
Add a new condition that will contain the new vim9script implementation
of the highlighter logic. Not done yet.

To test it out, you need a recent Vim 8.2 and in addition set the
configuration variable

    :let g:airline_experimental=1

Implementation for all the functions will follow.
2020-11-27 10:40:34 +01:00
Christian
b0d4a44f0c
add foldmarker to highlighter.vim 2020-11-27 10:40:33 +01:00
Christian
609205f1e8
remove trailing whitespace 2020-11-27 10:40:33 +01:00
Christian
06117a61e1
highlighter: windows terminal is not old win_term 2020-11-27 09:49:17 +01:00
Christian Brabandt
c8c0e7d9ff
Get rid of g:airline_gui_mode
This is needed for Neovim, because an external UI could be attached to
the same neovim server, so it does not make sense to define highlighting
groups with either only the cterm or the guifg attribute set.

So refactor the code slightly got get rid of this variable (and since
this variable is not needed anymore, we can also get rid of the guienter
and OptionSet autocommand).

fixes: #2261
2020-10-30 08:32:35 +01:00
Christian Brabandt
1240403ce5
highlighter: fix obvious spelling error 2020-01-20 12:32:06 +01:00
Christian Brabandt
a676af7c8a
highlighter: check for accents key
This is actually a work around for a broken installation. the dict p
should always contain the accents key (see `airline#themes#patch()`
function, that adds missing accents). So even if the theme does not
define the accents key, it should always exist.

However, an error while evaluating the statusline is extremely annoying,
so add some safeguards here and skip the following for loop.

related #2043
2020-01-20 12:28:04 +01:00
kazukazuinaina
cf6dcf5e19 update license's year in vim-airline 2020-01-06 11:22:49 +09:00
Christian Brabandt
c8a36e14e9
Updated Copyright Statements 2019-03-25 12:29:47 +01:00
Konstantinos Natsakis
53aa65a5ce Fix ctrlp memory leak 2019-01-17 15:34:19 +02:00
Christian Brabandt
f05f649be8
highlighter: even further refinement of when to skip groups 2018-11-13 13:57:15 +01:00
Christian Brabandt
cfd373a5a2
highlighter: Better check, when to skip groups
Groupnames like 'airline_c1_to_airline_x_inactive' still have to be
processed, so do not skip them.

Also for the tabline, '_inactive' groups are not used, so skip them
2018-11-13 13:48:26 +01:00
Christian Brabandt
78e67897a4
highlight: fix previous commit differently
Actually we can restrict the loop condition to only run 5 times instead
of 6 (which was an oversight).
2018-11-13 09:06:39 +01:00
Christian Brabandt
e66d65ebf4
highlighter: break out of loop at the end
thanks for mentioning @jottkaerr at
4d8a06a5a9 (commitcomment-31275754)
2018-11-13 08:50:10 +01:00
Christian Brabandt
4d8a06a5a9
highlighter: get rid of s:Get() function
Replace by a function that retuns the to be executed highlighting string

Should in theory be a bit faster, since the same function does not have
to be called 5 times per highlighting group.

It probably is not much better, but here are some random numbers:

Profiling:

Previously:
count  total (s)   self (s)
  199   0.022973   0.009909     let cmd = printf('hi %s %s %s %s %s %s %s %s', a:group, s:Get(colors, 0, 'guifg=')…

New:
count  total (s)   self (s)
   79   0.010166   0.000862     let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors))
2018-11-12 17:59:02 +01:00
Christian Brabandt
6c6c6c104f
highlighter: exec_separator will re-create '_to_' groups
so we don't need to re-create them in the main for loop of
airline#highlighter#highlight() and so skip those groups.
2018-11-12 05:18:53 +01:00
Christian Brabandt
f3d6a3542a
Revert "highlighter: also check separator groups for being defined"
This reverts commit 99971aa24d612f6161e77a1622e541f582505a05.
2018-11-11 21:18:13 +01:00
Christian Brabandt
99971aa24d
highlighter: also check separator groups for being defined
Make sure, to also check, if the separator groups have already been
defined. Once they are defined initially, they are usually available in
the palette group. So do not redefine them once they have been created
initially.

references #1779
2018-11-08 15:31:58 +01:00
Christian Brabandt
d57344a3c3
highlighter: skip more buffer related hi groups
Previously, we only checked for if the name starts with 'airline_c'

But there could as well be highlighting groups starting being called
'airline_b_to_airline_c5', but if buffer 5 is no longer visible in the
current viewport, then we do not need to recreate those groups.
2018-11-08 13:32:20 +01:00