Commit Graph

1171 Commits

Author SHA1 Message Date
Tim Pope
d73fe3c192 Fix inline diff expansion when foldmethod is not syntax
Also rearrange, so any other errors here don't break the basics.
2021-03-16 20:11:32 -04:00
Tim Pope
caf2907fd8 Retool discard operation during conflict
The use of --theirs for Unstaged and --ours for Staged was based
entirely on the way conflicts were represented in git status --short,
except, that's backwards, the staged column contains our side of the
merge so discarding it should use --theirs.  I never noticed because I
don't use this feature.

Fixing this is guaranteed to burn anybody who learned the whole
behavior, so let's promote 2X and 3X to official status, and require
opting in to the flipped default.

Also, since --ours and --theirs only touch the worktree, the correct
analogous operations for deletion is *not* git rm, but rather to remove
the worktree file directly.  So let's do that, and add it to 2X and 3X
too.

Closes https://github.com/tpope/vim-fugitive/issues/1699

References https://github.com/tpope/vim-fugitive/issues/1648
2021-03-16 16:27:38 -04:00
Tim Pope
cc525c99df Fix remaining :Gremove and :Gmove references 2021-03-16 16:27:38 -04:00
Tim Pope
f5bbd4eea0 Tiny optimization to s:Slash()
References https://github.com/tpope/vim-fugitive/issues/1701
2021-03-16 16:27:38 -04:00
Tim Pope
3eb6f316c0 Act globally when invoking inline diff maps on Head: line
Closes https://github.com/tpope/vim-fugitive/issues/1563
2021-03-15 23:40:48 -04:00
Tim Pope
776ce315c4 Ensure open folds after expanding inline diff 2021-03-15 23:40:48 -04:00
Tim Pope
e3b7cce2e6 Feed custom file under cursor into netrw's gx
References https://github.com/tpope/vim-fugitive/issues/1550
2021-03-15 23:38:09 -04:00
Tim Pope
10121f34f2 Remove Git dir checks on FileType events
In order for these checks to work, :filetype on must be invoked *after*
Fugitive is loaded.  Otherwise, the FileType event triggers before
FugitiveDetect() is called.

These file types are used almost exclusively inside of Git repositories,
and in the rare case they are not, we're not doing anything particularly
intrusive, so dropping the conditional should have little practical
impact.  An exception is fugitive#MapJumps(), which is designed to be
used exclusively with historical buffers, the status buffer, and
captured :Git output, so let's lock it down to those particular
workflows.
2021-03-15 17:46:00 -04:00
Tim Pope
f2956a923d Set b:git_dir early in BufReadCmd
We call :setlocal filetype=git before manually triggering BufReadPost,
which means that the FileType events in the plugin file containing
len(FugitiveGitDir()) checks all short circuited.  This wasn't noticed
before because:

* They're mostly nonessential, save for fugitive#MapJumps() which we
  also explicitly invoke in BufReadCmd.
* If :filetype on is invoked *after* Fugitive is loaded, then it will
  set the filetype a second time *after* we've properly set b:git_dir.
  (This was the case on my machine, except when reloading the plugin
  redefined the autocommands and thus reversed the order.)

The load order issue is also relevant to plain file buffers.  This will
require an additional fix.
2021-03-13 23:34:13 -05:00
Tim Pope
36f9211da2 End the guioptions+=! reign of terror
Changing :! was bad enough, but I cannot possibly fathom why
this affects system() too. Didn't we learn our lesson about options
affecting VimL execution from 'ignorecase'?

Closes https://github.com/tpope/vim-fugitive/issues/1416

Closes https://github.com/tpope/vim-fugitive/issues/1437

Closes https://github.com/tpope/vim-fugitive/issues/1533

References https://github.com/tpope/vim-fugitive/issues/1042
2021-03-13 18:01:06 -05:00
Tim Pope
977e3c805d Fix staging partial hunk near EOF lacking newline
This is a blind, untested fix.

Closes https://github.com/tpope/vim-fugitive/issues/1609
2021-03-13 17:53:59 -05:00
Tim Pope
a4a9acf44e Add initial :echo before job
This fixes output for `:echo 123|Git status`.
2021-03-13 17:53:59 -05:00
Tim Pope
b962714fcd Replace blame shell fiddling with s:TempCmd()
References https://github.com/tpope/vim-fugitive/issues/1644
2021-03-12 23:42:11 -05:00
Tim Pope
e704d15787 Fix tab complete of tree objects
Closes https://github.com/tpope/vim-fugitive/issues/1529
2021-03-12 23:38:11 -05:00
Tim Pope
6356bbc4a7 Fix argument parsing of :Gedit fugitive:\\...
When expecting <f-args> with -nargs=*, Vim rudely halves sequences of
consecutive backslashes, mutilating our URLs on Windows in the process.
Resort to splitting <q-args> by hand instead.

Closes https://github.com/tpope/vim-fugitive/issues/1579
2021-03-12 22:07:19 -05:00
Tim Pope
423aed15fc Delete backing temp file upon wiping buffer
We should probably default buftype to wipe so that these don't stack up
indefinitely by default, but one step at a time.
2021-03-12 18:21:21 -05:00
Tim Pope
1ccb082753 Rename temp state bufnr field to origin_bufnr
I intend to expand the use of this temp state to contexts where this
field could be erroneously interpreted as the buffer number of the temp
file itself.
2021-03-12 17:25:52 -05:00
Tim Pope
d0e277c7be Don't try to reuse terminal buffers for status window edits
Closes https://github.com/tpope/vim-fugitive/issues/1652
2021-03-11 01:40:44 -05:00
Tim Pope
753318ef83 Smarter diff jumping in :Git log
Closes https://github.com/tpope/vim-fugitive/issues/1689
2021-03-09 21:06:52 -05:00
Tim Pope
601bf2e225 Provide some <mods> handling on quickfix commands
Most notably, don't force an early redraw with :silent.

Closes https://github.com/tpope/vim-fugitive/issues/1685
2021-02-27 08:37:41 -05:00
Tim Pope
fad16e502a Better handling of git blame variable width date formats 2021-02-27 08:37:41 -05:00
Ian Homer
6c4c7c9aeb Account for closing windows when reloading status 2021-02-21 22:51:23 -05:00
Tim Pope
9e378fd9aa Resolve temp name used in :Git
This will enable us to use the temp name in a job backed --paginate.
Since temp file names have been the subject of various issues on win32
in the past, let's make this change sooner rather than later to get a
head start on any bug reports.
2021-02-21 14:56:41 -05:00
Tim Pope
783ec701fe Work around 'suffixes' in :Git completion
Closes https://github.com/tpope/vim-fugitive/issues/1682
2021-02-21 14:54:43 -05:00
Tim Pope
d1e74ac267 Move :Git --paginate helper function into :Git section 2021-02-20 21:59:03 -05:00
Tim Pope
eb4d75efb6 Fix :Gedit worktree-file
Closes https://github.com/tpope/vim-fugitive/issues/1679

References https://github.com/tpope/vim-fugitive/issues/1667
2021-02-19 18:47:13 -05:00
Tim Pope
0a35937003 Provide error message when Netrw can't be loaded 2021-02-16 21:04:13 -05:00
Tim Pope
d6809e9ee4 Use stderr for in-band job communication
Since stdout can contain arbitrary user data, let's touch it as little
as possible.  When using a pty, this has no effect, as everything goes
through stdout, but I aim to move handle --paginate with this same
pipeline, and that will not use a pty.
2021-02-15 20:11:56 -05:00
Tim Pope
15f32b0008 Guard against diff.noprefix in commit buffers 2021-02-15 20:11:56 -05:00
Tim Pope
d4bcc75ef6 Remove dispatch.vim backed fetch and push 2021-02-12 18:35:28 -05:00
Tim Pope
4c5f6fcaf5 Retire old :Gsplit! family of temp buffer commands 2021-02-12 13:49:07 -05:00
Tim Pope
5c821eb78d Don't default to work tree on :Gedit invalidref:file
Closes https://github.com/tpope/vim-fugitive/issues/1667
2021-02-11 17:05:05 -05:00
Tim Pope
7afa1cfaa6 Avoid presenting verbose command output as error
References https://github.com/tpope/vim-fugitive/issues/1643
2020-12-07 18:59:28 -05:00
Tim Pope
7bcfe539be Avoid window shenanigans if :diffoff restores options
Closes https://github.com/tpope/vim-fugitive/issues/1634
2020-11-27 09:40:22 -05:00
Tim Pope
866ecfff4e Enable Help: header
This change was inadvertantly omitted from
d2abfca08f.

References https://github.com/tpope/vim-fugitive/issues/1513
2020-11-24 02:01:39 -05:00
Pavol Juhas
e90478511d Restore correct cursor position in commit buffer
Use `lockmarks` in fugitive#BufReadCmd to avoid offsetting marks.
2020-11-24 02:00:14 -05:00
Maksim Odnoletkov
660d2ba2b6 Fix jumps from blame commits with ignore marks
c212d854d5 added initial support for
marks added by blame.markIgnoredLines and blame.markUnblamableLines.

One more change is needed to parse the blame line properly to enable
jumps.
2020-11-20 21:01:21 -05:00
Tim Pope
1a77f1c00e Recover from deleted temp script
Closes https://github.com/tpope/vim-fugitive/issues/1616
2020-10-26 20:31:54 -04:00
Tim Pope
89e6b5e4e1 Disable 'swapfile' early
This should eliminate the need to disable 'swapfile' in
fugitive#BufReadCmd(), but I'm inclined not to fix what isn't broken.

Closes https://github.com/tpope/vim-fugitive/issues/1598
2020-10-11 20:42:35 -04:00
Tim Pope
e12236b60a Fix reference to renamed function
Closes https://github.com/tpope/vim-fugitive/issues/1606
2020-09-27 06:05:05 -04:00
Ryosuke Ito
12011a475d Disable spell checking while blaming 2020-09-26 14:40:36 -04:00
Tim Pope
8080407ae9 Provide public diff closing function
Closes https://github.com/tpope/vim-fugitive/pull/1587
2020-09-26 12:21:52 -04:00
Tim Pope
49315d0c74 Fix :Gwrite DWIM in commit messages
Closes https://github.com/tpope/vim-fugitive/issues/1599
2020-09-24 07:32:12 -04:00
Tim Pope
4824b5b3fe Avoid empty string keys to prevent Vim 7 error
Closes https://github.com/tpope/vim-fugitive/issues/1113
2020-09-24 03:49:23 -04:00
Wu Yongwei
511d3035d4 Fix: digits in a user name was highlighted as time 2020-08-26 17:39:35 -04:00
Tim Pope
260182c65c Support partial staging after git add -N
Closes https://github.com/tpope/vim-fugitive/issues/1567
2020-07-30 21:36:29 -04:00
Tim Pope
9b6a24b131 Fix tab complete for :Git push --option
Closes https://github.com/tpope/vim-fugitive/issues/1570
2020-07-27 19:57:50 -04:00
Tim Pope
27a5c3abd2 Trigger OptionSet on automatic :diffoff
Closes https://github.com/tpope/vim-fugitive/issues/1545
2020-05-31 00:50:49 -04:00
Tim Pope
03fa78141e Improve weird :Ggrep --column quickfix title 2020-05-31 00:50:49 -04:00
Tim Pope
0646a53c6b Add Help: header
Closes https://github.com/tpope/vim-fugitive/issues/1513
2020-05-31 00:50:49 -04:00