Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions runtime/pack/dist/opt/helptoc/autoload/helptoc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@ vim9script noclear

# Config {{{1

const SHELL_PROMPT: string = g:
->get('helptoc', {})
->get('shell_prompt', '^\w\+@\w\+:\f\+\$\s')
var SHELL_PROMPT: string = ''

def UpdateUserSettings() #{{{2
var new_prompt: string = g:
->get('helptoc', {})
->get('shell_prompt', '^\w\+@\w\+:\f\+\$\s')
if new_prompt != SHELL_PROMPT
SHELL_PROMPT = new_prompt
# invalidate cache: user config has changed
unlet! b:toc
endif
enddef

UpdateUserSettings()

# Init {{{1

Expand Down Expand Up @@ -141,6 +152,8 @@ export def Open() #{{{2
return
endif

UpdateUserSettings()

# invalidate the cache if the buffer's contents has changed
if exists('b:toc') && &filetype != 'man'
if b:toc.changedtick != b:changedtick
Expand Down
Loading