Remove --intend-to-add from :Gstatus i
You can't actually apply a hunk to a file added with --intend-to-add, so this did not pair well with the hunk expansion behavior.
This commit is contained in:
parent
d88a0f8465
commit
994d1b518f
@ -1808,7 +1808,7 @@ function! fugitive#BufReadStatus() abort
|
|||||||
nnoremap <buffer> <silent> gr :<C-U>exe <SID>StageJump(v:count, 'Rebasing')<CR>
|
nnoremap <buffer> <silent> gr :<C-U>exe <SID>StageJump(v:count, 'Rebasing')<CR>
|
||||||
nnoremap <buffer> <silent> C :<C-U>Gcommit<CR>:echohl WarningMsg<Bar>echo ':Gstatus C is deprecated in favor of cc'<Bar>echohl NONE<CR>
|
nnoremap <buffer> <silent> C :<C-U>Gcommit<CR>:echohl WarningMsg<Bar>echo ':Gstatus C is deprecated in favor of cc'<Bar>echohl NONE<CR>
|
||||||
nnoremap <buffer> <silent> a :<C-U>execute <SID>Do('Toggle',0)<CR>
|
nnoremap <buffer> <silent> a :<C-U>execute <SID>Do('Toggle',0)<CR>
|
||||||
nnoremap <buffer> <silent> i :<C-U>execute <SID>StageIntend(v:count1)<CR>
|
nnoremap <buffer> <silent> i :<C-U>execute <SID>NextExpandedHunk(v:count1)<CR>
|
||||||
exe 'nnoremap <buffer> <silent>' nowait "= :<C-U>execute <SID>StageInline('toggle',line('.'),v:count)<CR>"
|
exe 'nnoremap <buffer> <silent>' nowait "= :<C-U>execute <SID>StageInline('toggle',line('.'),v:count)<CR>"
|
||||||
exe 'nnoremap <buffer> <silent>' nowait "< :<C-U>execute <SID>StageInline('show', line('.'),v:count)<CR>"
|
exe 'nnoremap <buffer> <silent>' nowait "< :<C-U>execute <SID>StageInline('show', line('.'),v:count)<CR>"
|
||||||
exe 'nnoremap <buffer> <silent>' nowait "> :<C-U>execute <SID>StageInline('hide', line('.'),v:count)<CR>"
|
exe 'nnoremap <buffer> <silent>' nowait "> :<C-U>execute <SID>StageInline('hide', line('.'),v:count)<CR>"
|
||||||
@ -2730,19 +2730,15 @@ function! s:StageInline(mode, ...) abort
|
|||||||
return lnum
|
return lnum
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:StageIntend(count) abort
|
function! s:NextExpandedHunk(count) abort
|
||||||
for i in range(a:count)
|
for i in range(a:count)
|
||||||
if getline('.')[0:1] ==# '? '
|
if getline('.') =~# '^Unstaged\|^Untracked'
|
||||||
call s:TreeChomp('add', '--intent-to-add', '--', s:Tree() . '/' . getline('.')[2:-1])
|
|
||||||
-
|
|
||||||
exe s:ReloadStatus()
|
|
||||||
elseif getline('.') =~# '^Unstaged\|^Untracked'
|
|
||||||
call s:TreeChomp('add', '--intent-to-add', '--', s:Tree())
|
call s:TreeChomp('add', '--intent-to-add', '--', s:Tree())
|
||||||
exe s:ReloadStatus()
|
exe s:ReloadStatus()
|
||||||
else
|
else
|
||||||
call s:StageInline('show', line('.'), 1)
|
call s:StageInline('show', line('.'), 1)
|
||||||
endif
|
endif
|
||||||
call s:NextFileHunk(1)
|
call search('^[A-Z?] .\|^diff --\|^@','W')
|
||||||
endfor
|
endfor
|
||||||
return '.'
|
return '.'
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -270,11 +270,6 @@ X Discard the change under the cursor. This uses
|
|||||||
*fugitive_>*
|
*fugitive_>*
|
||||||
> Remove the inline diff of the file under the cursor.
|
> Remove the inline diff of the file under the cursor.
|
||||||
|
|
||||||
*fugitive_i*
|
|
||||||
i On untracked files, call |:Git| add --intent-to-add.
|
|
||||||
Otherwise, move to next hunk, expanding inline diffs
|
|
||||||
automatically.
|
|
||||||
|
|
||||||
*fugitive_dd*
|
*fugitive_dd*
|
||||||
dd Perform a |:Gdiffsplit| on the file under the cursor.
|
dd Perform a |:Gdiffsplit| on the file under the cursor.
|
||||||
|
|
||||||
@ -328,6 +323,10 @@ C Open the commit containing the current file.
|
|||||||
) Jump to the next file or hunk.
|
) Jump to the next file or hunk.
|
||||||
<C-N>
|
<C-N>
|
||||||
|
|
||||||
|
*fugitive_i*
|
||||||
|
i Jump to the next file or hunk, expanding inline diffs
|
||||||
|
automatically.
|
||||||
|
|
||||||
*fugitive_[[*
|
*fugitive_[[*
|
||||||
[[ Jump to the previous section.
|
[[ Jump to the previous section.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user