aboutsummaryrefslogtreecommitdiff
path: root/.local/share/nvim/site
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2022-12-14 19:57:12 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2022-12-14 19:57:12 +0100
commit0468bae575e0c8a870296074f632e47f937c27cb (patch)
tree1a29380c764296215ffcdf865246422c319f6545 /.local/share/nvim/site
parent38caf6ea1b37e6e99f44accb5ff4f9361648ac34 (diff)
add gdbinit
Diffstat (limited to '.local/share/nvim/site')
-rw-r--r--.local/share/nvim/site/autoload/plug.vim22
1 files changed, 15 insertions, 7 deletions
diff --git a/.local/share/nvim/site/autoload/plug.vim b/.local/share/nvim/site/autoload/plug.vim
index 46416b8..652caa8 100644
--- a/.local/share/nvim/site/autoload/plug.vim
+++ b/.local/share/nvim/site/autoload/plug.vim
@@ -352,7 +352,7 @@ function! plug#end()
endif
let lod = { 'ft': {}, 'map': {}, 'cmd': {} }
- if exists('g:did_load_filetypes')
+ if get(g:, 'did_load_filetypes', 0)
filetype off
endif
for name in g:plugs_order
@@ -2621,26 +2621,34 @@ function! s:preview_commit()
let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}')
if empty(sha)
- return
+ let name = matchstr(getline('.'), '^- \zs[^:]*\ze:$')
+ if empty(name)
+ return
+ endif
+ let title = 'HEAD@{1}..'
+ let command = 'git diff --no-color HEAD@{1}'
+ else
+ let title = sha
+ let command = 'git show --no-color --pretty=medium '.sha
+ let name = s:find_name(line('.'))
endif
- let name = s:find_name(line('.'))
if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir)
return
endif
if exists('g:plug_pwindow') && !s:is_preview_window_open()
execute g:plug_pwindow
- execute 'e' sha
+ execute 'e' title
else
- execute 'pedit' sha
+ execute 'pedit' title
wincmd P
endif
- setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable
+ setlocal previewwindow filetype=git buftype=nofile bufhidden=wipe nobuflisted modifiable
let batchfile = ''
try
let [sh, shellcmdflag, shrd] = s:chsh(1)
- let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha
+ let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && '.command
if s:is_win
let [batchfile, cmd] = s:batchfile(cmd)
endif