Update generated neovim config
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
diff --git a/dir/file1 b/dir/file1
|
||||
index dd2b945..b81ef66 100644
|
||||
--- a/dir/file1
|
||||
+++ b/dir/file1
|
||||
@@ -247,3 +247,3 @@ Hunk header 1
|
||||
Line 1
|
||||
- Previous line 2
|
||||
+ Current line 2
|
||||
Line 3
|
||||
@@ -317,4 +317,4 @@
|
||||
Line 11
|
||||
+Added line 12
|
||||
+Added line 13
|
||||
|
||||
diff --git a/file b/file
|
||||
index a0a225b..9f8c05f 100644
|
||||
--- a/file
|
||||
+++ b/file
|
||||
@@ -283,4 +283,4 @@
|
||||
+++
|
||||
-+++ Deleted line 112
|
||||
---- Deleted line 113
|
||||
---
|
||||
@ -0,0 +1,4 @@
|
||||
aaa
|
||||
uuu
|
||||
|
||||
xxx
|
||||
@ -0,0 +1,2 @@
|
||||
|
||||
# This is a mock of Git template for its `GIT_EDITOR`
|
||||
@ -0,0 +1 @@
|
||||
ref: refs/heads/tmp
|
||||
@ -0,0 +1 @@
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
Line 1
|
||||
Line 2
|
||||
Line 3
|
||||
Line 4
|
||||
Line 5
|
||||
@ -0,0 +1 @@
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
|
||||
GIT-PUSH(1) Git Manual GIT-PUSH(1)
|
||||
|
||||
NAME
|
||||
git-push - Update remote refs along with associated objects
|
||||
|
||||
SYNOPSIS
|
||||
git push [--all | --branches | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
|
||||
[--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-q | --quiet] [-v | --verbose]
|
||||
[-u | --set-upstream] [-o <string> | --push-option=<string>]
|
||||
[--[no-]signed|--signed=(true|false|if-asked)]
|
||||
[--force-with-lease[=<refname>[:<expect>]] [--force-if-includes]]
|
||||
[--no-verify] [<repository> [<refspec>...]]
|
||||
|
||||
DESCRIPTION
|
||||
A truncated output of `git help push` for testing purposes
|
||||
|
||||
OPTIONS
|
||||
<repository>
|
||||
The "remote" repository. Should be parsed as option.
|
||||
|
||||
<refspec>...
|
||||
Specify what destination ref to update with what source object.
|
||||
Some other very important information.
|
||||
|
||||
--all, --branches
|
||||
Push all branches (i.e. refs under refs/heads/); cannot be used with
|
||||
other <refspec>.
|
||||
|
||||
--prune
|
||||
Remove remote branches that don’t have a local counterpart.
|
||||
|
||||
This line contains --do-not-parse flag which should not be parsed.
|
||||
|
||||
--another-no-parse
|
||||
|
||||
-n, --dry-run
|
||||
Do everything except actually send the updates.
|
||||
|
||||
-vv
|
||||
A single dash flag but with two letters afterwards.
|
||||
|
||||
--[no-]signed, --signed=(true|false|if-asked)
|
||||
This is some hard to parse options.
|
||||
Should prefer '--signed' over '--signed='.
|
||||
|
||||
--receive-pack=<git-receive-pack>, --exec=<git-receive-pack>
|
||||
Another hard to parse.
|
||||
|
||||
--[no-]force-with-lease, --force-with-lease=<refname>,
|
||||
--force-with-lease=<refname>:<expect>
|
||||
An entry which documents same flag several times.
|
||||
|
||||
-4, --ipv4
|
||||
Use IPv4 addresses only, ignoring IPv6 addresses.
|
||||
|
||||
-6, --ipv6
|
||||
Use IPv6 addresses only, ignoring IPv4 addresses.
|
||||
|
||||
NEW SECTION
|
||||
--not-an-option
|
||||
Although formatted as an option, it is not in an appropriate section.
|
||||
@ -0,0 +1,60 @@
|
||||
commit 5ed8432441b495fa9bd4ad2e4f635bae64e95cc2
|
||||
Author: Neo McVim <neo.mcvim@gmail.com>
|
||||
Date: Sat May 4 16:24:15 2024 +0300
|
||||
|
||||
Commit 1
|
||||
|
||||
Important details about commit.
|
||||
Even more details about commit.
|
||||
|
||||
diff --git a/dir/file-before b/dir/file-after
|
||||
index dd2b945..b81ef66 100644
|
||||
--- a/dir/file-before
|
||||
+++ b/dir/file-after
|
||||
@@ -1,3 +1,3 @@ Hunk header 1
|
||||
Line 1
|
||||
- Previous line 2
|
||||
+ Current line 2
|
||||
Line 3
|
||||
@@ -317,4 +317,4 @@
|
||||
Line 11
|
||||
+Added line 12
|
||||
+Added line 13
|
||||
|
||||
diff --git a/file b/file
|
||||
index a0a225b..9f8c05f 100644
|
||||
--- a/file
|
||||
+++ b/file
|
||||
@@ -283,4 +283,4 @@
|
||||
+++
|
||||
-+++ Deleted line 112
|
||||
---- Deleted line 113
|
||||
---
|
||||
|
||||
commit 7264474d3bda16d0098a7f89a4143fe4db3d82cf
|
||||
Author: Neo McVim <neo.mcvim@gmail.com>
|
||||
Date: Sat May 4 16:20:29 2024 +0300
|
||||
|
||||
Commit 2
|
||||
|
||||
diff --git a/dir/file1 b/dir/file1
|
||||
index dd2b945..b81ef66 100644
|
||||
--- a/dir/file1
|
||||
+++ b/dir/file1
|
||||
@@ -247 +247 @@ Hunk header 1
|
||||
- Previous line 02
|
||||
+ Current line 02
|
||||
@@ -317,4 +317,4 @@
|
||||
Line 011
|
||||
+Added line 012
|
||||
+Added line 013
|
||||
|
||||
diff --git a/file.lua b/file.lua
|
||||
index a0a225b..9f8c05f 100644
|
||||
--- a/file.lua
|
||||
+++ b/file.lua
|
||||
@@ -1,4 +1,4 @@
|
||||
+++
|
||||
-+++ local a = 'deleted'
|
||||
---- local b = 'lines'
|
||||
---
|
||||
@ -0,0 +1,74 @@
|
||||
_G.process_log = {}
|
||||
local process_id = 1
|
||||
local new_process = function(pid)
|
||||
local is_active, is_closing = true, false
|
||||
return {
|
||||
pid = pid,
|
||||
close = function(_)
|
||||
table.insert(_G.process_log, 'Process ' .. pid .. ' was closed.')
|
||||
is_active, is_closing = false, true
|
||||
end,
|
||||
is_closing = function(_) return is_closing end,
|
||||
is_active = function(_) return is_active end,
|
||||
}
|
||||
end
|
||||
|
||||
-- Define object containing the queue with mocking stdio data.
|
||||
-- Each element is an array of tables with the format:
|
||||
-- - Element 1 is stdio type. One of "in", "out", "err".
|
||||
-- - Element 2 is the feed of the pipe. Can be `nil`, `string`, `string[]`.
|
||||
_G.stdio_queue = {}
|
||||
local process_pipe_indexes = {}
|
||||
vim.loop.new_pipe = function()
|
||||
local cur_process_id = process_id
|
||||
local process_pipe_data = _G.stdio_queue[cur_process_id] or {}
|
||||
|
||||
process_pipe_indexes[cur_process_id] = (process_pipe_indexes[cur_process_id] or 0) + 1
|
||||
local cur_pipe_data = process_pipe_data[process_pipe_indexes[cur_process_id]] or {}
|
||||
local cur_io_field, cur_feed = cur_pipe_data[1], cur_pipe_data[2]
|
||||
|
||||
if type(cur_feed) ~= 'table' then cur_feed = { cur_feed } end
|
||||
|
||||
return {
|
||||
read_start = function(_, callback)
|
||||
for _, x in ipairs(cur_feed) do
|
||||
if type(x) == 'table' then callback(x.err, nil) end
|
||||
if type(x) == 'string' then callback(nil, x) end
|
||||
end
|
||||
callback(nil, nil)
|
||||
end,
|
||||
write = function(_, chars)
|
||||
local msg = string.format('Stream %s for process %s wrote: %s', cur_io_field, cur_process_id, chars)
|
||||
table.insert(_G.process_log, msg)
|
||||
end,
|
||||
shutdown = function()
|
||||
local msg = string.format('Stream %s for process %s was shut down.', cur_io_field, cur_process_id)
|
||||
table.insert(_G.process_log, msg)
|
||||
end,
|
||||
close = function()
|
||||
table.insert(_G.process_log, string.format('Stream %s for process %s was closed.', cur_io_field, cur_process_id))
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
-- Array of data to mock the process. Each element can be either `nil` or
|
||||
-- a table with the following fields:
|
||||
-- - <action> `(function|nil)` - callable to simulate job's side-effects.
|
||||
-- - <duration> `(number|nil)` - how long a process should take. Default: 0.
|
||||
-- - <exit_code> `(number|nil)` - exit code. Default: 0.
|
||||
_G.process_mock_data = {}
|
||||
_G.spawn_log = {}
|
||||
vim.loop.spawn = function(path, options, on_exit)
|
||||
local options_without_callables = vim.deepcopy(options) or {}
|
||||
options_without_callables.stdio = nil
|
||||
table.insert(_G.spawn_log, { executable = path, options = options_without_callables })
|
||||
|
||||
local pid = process_id
|
||||
process_id = process_id + 1
|
||||
|
||||
local mock_data = _G.process_mock_data[pid] or {}
|
||||
if vim.is_callable(mock_data.action) then mock_data.action(path, options) end
|
||||
vim.defer_fn(function() on_exit(mock_data.exit_code or 0) end, mock_data.duration or 0)
|
||||
|
||||
return new_process(pid), pid
|
||||
end
|
||||
Reference in New Issue
Block a user