comparison autoload/plug.vim @ 4:1a705d7a7521

working on stuff
author luka
date Thu, 23 Oct 2025 12:33:51 -0400
parents a4ec03f77554
children
comparison
equal deleted inserted replaced
3:951569ccb9c7 4:1a705d7a7521
370 endif 370 endif
371 endfor 371 endfor
372 372
373 for [cmd, names] in items(lod.cmd) 373 for [cmd, names] in items(lod.cmd)
374 execute printf( 374 execute printf(
375 \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)', 375 \ has('patch-7.4.1898')
376 \ cmd, string(cmd), string(names)) 376 \ ? 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, <q-mods> ,%s)'
377 \ : 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)'
378 \ , cmd, string(cmd), string(names))
377 endfor 379 endfor
378 380
379 for [map, names] in items(lod.map) 381 for [map, names] in items(lod.map)
380 for [mode, map_prefix, key_prefix] in 382 for [mode, map_prefix, key_prefix] in
381 \ [['i', '<C-\><C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] 383 \ [['i', '<C-\><C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
649 execute 'autocmd! PlugLOD FileType' a:pat 651 execute 'autocmd! PlugLOD FileType' a:pat
650 call s:doautocmd('filetypeplugin', 'FileType') 652 call s:doautocmd('filetypeplugin', 'FileType')
651 call s:doautocmd('filetypeindent', 'FileType') 653 call s:doautocmd('filetypeindent', 'FileType')
652 endfunction 654 endfunction
653 655
654 function! s:lod_cmd(cmd, bang, l1, l2, args, names) 656 if has('patch-7.4.1898')
655 call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) 657 function! s:lod_cmd(cmd, bang, l1, l2, args, mods, names)
656 call s:dobufread(a:names) 658 call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
657 execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) 659 call s:dobufread(a:names)
658 endfunction 660 execute printf('%s %s%s%s %s', a:mods, (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
661 endfunction
662 else
663 function! s:lod_cmd(cmd, bang, l1, l2, args, names)
664 call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
665 call s:dobufread(a:names)
666 execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
667 endfunction
668 endif
659 669
660 function! s:lod_map(map, names, with_prefix, prefix) 670 function! s:lod_map(map, names, with_prefix, prefix)
661 call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) 671 call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
662 call s:dobufread(a:names) 672 call s:dobufread(a:names)
663 let extra = '' 673 let extra = ''