From 61908577df2a212829d4b6c8d1a022cc41c8c2c1 Mon Sep 17 00:00:00 2001 From: Dan Date: Sun, 25 Jul 2021 22:04:44 -0400 Subject: [PATCH] Use --sourced instead of --self (functionality reversed). This naming more closely matches the behavior. With --no-self, self timings were still utilized (as part of self+sourced). Now, with --no-sourced, source timings are not utilized. --- autoload/startuptime.vim | 12 ++++++------ doc/startuptime.txt | 13 +++++++------ doc/tags | 2 +- plugin/startuptime.vim | 4 ++++ 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/autoload/startuptime.vim b/autoload/startuptime.vim index 6c81d49..ed21d76 100644 --- a/autoload/startuptime.vim +++ b/autoload/startuptime.vim @@ -387,7 +387,7 @@ function! s:Augment(items, options) abort let l:result = deepcopy(a:items) for l:item in l:result if l:item.type ==# s:sourcing_event_type - let l:key = a:options.self ? 'self' : 'self+sourced' + let l:key = a:options.sourced ? 'self+sourced' : 'self' elseif l:item.type ==# s:other_event_type let l:key = 'elapsed' else @@ -915,7 +915,7 @@ function! s:Options(args) abort let l:options = { \ 'help': 0, \ 'other_events': g:startuptime_other_events, - \ 'self': g:startuptime_self, + \ 'sourced': g:startuptime_sourced, \ 'sort': g:startuptime_sort, \ 'sourcing_events': g:startuptime_sourcing_events, \ 'tries': g:startuptime_tries, @@ -931,8 +931,8 @@ function! s:Options(args) abort break elseif l:arg ==# '--other-events' || l:arg ==# '--no-other-events' let l:options.other_events = l:arg ==# '--other-events' - elseif l:arg ==# '--self' || l:arg ==# '--no-self' - let l:options.self = l:arg ==# '--self' + elseif l:arg ==# '--sourced' || l:arg ==# '--no-sourced' + let l:options.sourced = l:arg ==# '--sourced' elseif l:arg ==# '--sort' || l:arg ==# '--no-sort' let l:options.sort = l:arg ==# '--sort' elseif l:arg ==# '--sourcing-events' || l:arg ==# '--no-sourcing-events' @@ -963,7 +963,7 @@ function! startuptime#CompleteOptions(...) abort let l:args = [ \ '--help', \ '--other-events', '--no-other-events', - \ '--self', '--no-self', + \ '--sourced', '--no-sourced', \ '--sort', '--no-sort', \ '--sourcing-events', '--no-sourcing-events', \ '--tries', @@ -976,7 +976,7 @@ endfunction " \ [--sort] [--no-sort] " \ [--sourcing-events] [--no-sourcing-events] " \ [--other-events] [--no-other-events] -" \ [--self] [--no-self] +" \ [--sourced] [--no-sourced] " \ [--tries INT] function! startuptime#StartupTime(mods, ...) abort if !has('nvim') && !has('terminal') diff --git a/doc/startuptime.txt b/doc/startuptime.txt index e7df0da..00feb6c 100644 --- a/doc/startuptime.txt +++ b/doc/startuptime.txt @@ -53,8 +53,8 @@ Arguments ~ events are included. * `--other-events` and `--no-other-events` specify whether other events are included. -* `--self` and `--no-self` specify whether to use 'self' timings for sourcing - events (otherwise, 'self+sourced' timings are used). +* `--sourced` and `--no-sourced` specify whether to use 'self+sourced' timings + for sourcing events (otherwise, 'self' timings are used). * `--tries` specifies how many startup times are averaged. * `--help` shows this help documentation. > @@ -62,7 +62,7 @@ Arguments ~ \ [--sort] [--no-sort] \ [--sourcing-events] [--no-sourcing-events] \ [--other-events] [--no-other-events] - \ [--self] [--no-self] + \ [--sourced] [--no-sourced] \ [--tries INT] \ [--help] @@ -114,9 +114,10 @@ than these options. *g:startuptime_other_events* `1` Specifies whether other events are are included -*g:startuptime_self* `0` - Specifies whether to use 'self' - timings for sourcing events +*g:startuptime_sourced* `1` + Specifies whether to include + 'sourced' timings (in addition to + 'self' timings) for sourcing events *g:startuptime_event_width* `20` Event column width *g:startuptime_time_width* `6` diff --git a/doc/tags b/doc/tags index f7f5921..13e5cb3 100644 --- a/doc/tags +++ b/doc/tags @@ -8,8 +8,8 @@ g:startuptime_more_info_key_seq startuptime.txt /*g:startuptime_more_info_key_se g:startuptime_other_events startuptime.txt /*g:startuptime_other_events* g:startuptime_percent_width startuptime.txt /*g:startuptime_percent_width* g:startuptime_plot_width startuptime.txt /*g:startuptime_plot_width* -g:startuptime_self startuptime.txt /*g:startuptime_self* g:startuptime_sort startuptime.txt /*g:startuptime_sort* +g:startuptime_sourced startuptime.txt /*g:startuptime_sourced* g:startuptime_sourcing_events startuptime.txt /*g:startuptime_sourcing_events* g:startuptime_split_edit_key_seq startuptime.txt /*g:startuptime_split_edit_key_seq* g:startuptime_startup_indent startuptime.txt /*g:startuptime_startup_indent* diff --git a/plugin/startuptime.vim b/plugin/startuptime.vim index 2d0c1a7..22eacfa 100644 --- a/plugin/startuptime.vim +++ b/plugin/startuptime.vim @@ -52,7 +52,11 @@ let g:startuptime_sort = get(g:, 'startuptime_sort', 1) let g:startuptime_tries = get(g:, 'startuptime_tries', 1) let g:startuptime_sourcing_events = get(g:, 'startuptime_sourcing_events', 1) let g:startuptime_other_events = get(g:, 'startuptime_other_events', 1) +" '--self' was removed, with '--sourced' being used now to control the same +" setting (but reversed). The following handling allows configurations to +" continue working if 'startuptime_self' was specified. let g:startuptime_self = get(g:, 'startuptime_self', 0) +let g:startuptime_sourced = get(g:, 'startuptime_sourced', !g:startuptime_self) let g:startuptime_startup_indent = \ get(g:, 'startuptime_startup_indent', 7)