Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring Vim9 Variable Arguments to airline/themes #2605

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

igbanam
Copy link
Contributor

@igbanam igbanam commented Dec 7, 2022

Vim9 now has variable arguments :h vim9-variable-arguments. This change refactors the current capabilities with vim9script variable arguments.

Now, there is no easy way to test this. I had to

  • clone vim-airline
  • use the local copy as my plugin — Plug ~/path/to/locally-clonned/vim-airline
  • for every change…
    • copy-paste the scenarios into an echo to check that the refactor works as should

I had to resort to this sort of testing because thinca/vim-themis#74 is yet unresolved.

My test cases are below

generate_color_map with 6 variables

:echo airline#themes#generate_color_map([ 1, 1, 1, 1, '1' ], [ 2, 2, 2, 2, '2' ], [ 3, 3, 3, 3, '3' ], [ 4, 4, 4, 4, '4' ], [ 5, 5, 5, 5, '5' ], [ 6, 6, 6, 6, '6' ])

generate color_map with 3 variables

:echo airline#themes#generate_color_map([ 1, 1, 1, 1, '1' ], [ 2, 2, 2, 2, '2' ], [ 3, 3, 3, 3, '3' ])

get_highlight with extra arguments

:echo airline#themes#get_highlight('Foo', 'bold', 'italic')

get_highlight2 with extra arguments

:echo airline#themes#get_highlight2(['Foo','bg'], ['Foo','fg'], 'italic', 'bold')

@chrisbra
Copy link
Member

chrisbra commented Dec 7, 2022

cool thanks. Great to see some changes in vim9 script :)

@chrisbra chrisbra merged commit 5f5e00f into vim-airline:master Dec 7, 2022
@igbanam igbanam deleted the theme/vim9-variable-arguments branch December 7, 2022 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants