Skip to content

Commit 6190857

Browse files
committed
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.
1 parent a35b775 commit 6190857

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

autoload/startuptime.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ function! s:Augment(items, options) abort
387387
let l:result = deepcopy(a:items)
388388
for l:item in l:result
389389
if l:item.type ==# s:sourcing_event_type
390-
let l:key = a:options.self ? 'self' : 'self+sourced'
390+
let l:key = a:options.sourced ? 'self+sourced' : 'self'
391391
elseif l:item.type ==# s:other_event_type
392392
let l:key = 'elapsed'
393393
else
@@ -915,7 +915,7 @@ function! s:Options(args) abort
915915
let l:options = {
916916
\ 'help': 0,
917917
\ 'other_events': g:startuptime_other_events,
918-
\ 'self': g:startuptime_self,
918+
\ 'sourced': g:startuptime_sourced,
919919
\ 'sort': g:startuptime_sort,
920920
\ 'sourcing_events': g:startuptime_sourcing_events,
921921
\ 'tries': g:startuptime_tries,
@@ -931,8 +931,8 @@ function! s:Options(args) abort
931931
break
932932
elseif l:arg ==# '--other-events' || l:arg ==# '--no-other-events'
933933
let l:options.other_events = l:arg ==# '--other-events'
934-
elseif l:arg ==# '--self' || l:arg ==# '--no-self'
935-
let l:options.self = l:arg ==# '--self'
934+
elseif l:arg ==# '--sourced' || l:arg ==# '--no-sourced'
935+
let l:options.sourced = l:arg ==# '--sourced'
936936
elseif l:arg ==# '--sort' || l:arg ==# '--no-sort'
937937
let l:options.sort = l:arg ==# '--sort'
938938
elseif l:arg ==# '--sourcing-events' || l:arg ==# '--no-sourcing-events'
@@ -963,7 +963,7 @@ function! startuptime#CompleteOptions(...) abort
963963
let l:args = [
964964
\ '--help',
965965
\ '--other-events', '--no-other-events',
966-
\ '--self', '--no-self',
966+
\ '--sourced', '--no-sourced',
967967
\ '--sort', '--no-sort',
968968
\ '--sourcing-events', '--no-sourcing-events',
969969
\ '--tries',
@@ -976,7 +976,7 @@ endfunction
976976
" \ [--sort] [--no-sort]
977977
" \ [--sourcing-events] [--no-sourcing-events]
978978
" \ [--other-events] [--no-other-events]
979-
" \ [--self] [--no-self]
979+
" \ [--sourced] [--no-sourced]
980980
" \ [--tries INT]
981981
function! startuptime#StartupTime(mods, ...) abort
982982
if !has('nvim') && !has('terminal')

doc/startuptime.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ Arguments ~
5353
events are included.
5454
* `--other-events` and `--no-other-events` specify whether other events
5555
are included.
56-
* `--self` and `--no-self` specify whether to use 'self' timings for sourcing
57-
events (otherwise, 'self+sourced' timings are used).
56+
* `--sourced` and `--no-sourced` specify whether to use 'self+sourced' timings
57+
for sourcing events (otherwise, 'self' timings are used).
5858
* `--tries` specifies how many startup times are averaged.
5959
* `--help` shows this help documentation.
6060
>
6161
:StartupTime
6262
\ [--sort] [--no-sort]
6363
\ [--sourcing-events] [--no-sourcing-events]
6464
\ [--other-events] [--no-other-events]
65-
\ [--self] [--no-self]
65+
\ [--sourced] [--no-sourced]
6666
\ [--tries INT]
6767
\ [--help]
6868
@@ -114,9 +114,10 @@ than these options.
114114
*g:startuptime_other_events* `1`
115115
Specifies whether other events are
116116
are included
117-
*g:startuptime_self* `0`
118-
Specifies whether to use 'self'
119-
timings for sourcing events
117+
*g:startuptime_sourced* `1`
118+
Specifies whether to include
119+
'sourced' timings (in addition to
120+
'self' timings) for sourcing events
120121
*g:startuptime_event_width* `20`
121122
Event column width
122123
*g:startuptime_time_width* `6`

doc/tags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ g:startuptime_more_info_key_seq startuptime.txt /*g:startuptime_more_info_key_se
88
g:startuptime_other_events startuptime.txt /*g:startuptime_other_events*
99
g:startuptime_percent_width startuptime.txt /*g:startuptime_percent_width*
1010
g:startuptime_plot_width startuptime.txt /*g:startuptime_plot_width*
11-
g:startuptime_self startuptime.txt /*g:startuptime_self*
1211
g:startuptime_sort startuptime.txt /*g:startuptime_sort*
12+
g:startuptime_sourced startuptime.txt /*g:startuptime_sourced*
1313
g:startuptime_sourcing_events startuptime.txt /*g:startuptime_sourcing_events*
1414
g:startuptime_split_edit_key_seq startuptime.txt /*g:startuptime_split_edit_key_seq*
1515
g:startuptime_startup_indent startuptime.txt /*g:startuptime_startup_indent*

plugin/startuptime.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ let g:startuptime_sort = get(g:, 'startuptime_sort', 1)
5252
let g:startuptime_tries = get(g:, 'startuptime_tries', 1)
5353
let g:startuptime_sourcing_events = get(g:, 'startuptime_sourcing_events', 1)
5454
let g:startuptime_other_events = get(g:, 'startuptime_other_events', 1)
55+
" '--self' was removed, with '--sourced' being used now to control the same
56+
" setting (but reversed). The following handling allows configurations to
57+
" continue working if 'startuptime_self' was specified.
5558
let g:startuptime_self = get(g:, 'startuptime_self', 0)
59+
let g:startuptime_sourced = get(g:, 'startuptime_sourced', !g:startuptime_self)
5660

5761
let g:startuptime_startup_indent =
5862
\ get(g:, 'startuptime_startup_indent', 7)

0 commit comments

Comments
 (0)