Skip to content

Commit 29eeb78

Browse files
committed
using a fork of flatten.nvim
TODO: switch back to main repo if/when <willothy/flatten.nvim#113> is merged.
1 parent dd618cf commit 29eeb78

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

lazy-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"flatten.nvim": { "branch": "main", "commit": "72527798e75b5e34757491947c2cb853ce21dc0e" },
3-
"gitsigns.nvim": { "branch": "main", "commit": "8bdaccdb897945a3c99c1ad8df94db0ddf5c8790" },
2+
"flatten.nvim": { "branch": "main", "commit": "0fd34e45490ed7f97c9ed28d0a1598591e9de8e7" },
3+
"gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" },
44
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
55
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
6-
"nvim-lspconfig": { "branch": "master", "commit": "03bc581e05e81d33808b42b2d7e76d70adb3b595" },
6+
"nvim-lspconfig": { "branch": "master", "commit": "036885e8e5456d3907626b634693234f628afef6" },
77
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
8-
"oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" },
8+
"oil.nvim": { "branch": "master", "commit": "08c2bce8b00fd780fb7999dbffdf7cd174e896fb" },
99
"tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" },
1010
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }
1111
}

lua/config/plugins/flatten.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ return {
33
open = "alternate"
44
},
55
hooks = {
6-
post_open = function ()
7-
require("flatten").config.window.open = "alternate"
6+
-- relies on https://github.com/willothy/flatten.nvim/pull/113
7+
pre_open = function(data)
8+
if data.data.current then return { window = { open = "current" } } end
9+
end,
10+
guest_data = function()
11+
return { current = vim.bo.filetype == "gitcommit" or vim.bo.filetype == "gitrebase" }
812
end
913
},
1014
}

lua/plugins/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ return {
33
{ import = "plugins.lsp" },
44
{ 'stevearc/oil.nvim', lazy = false, opts = require("config.plugins.oil") },
55
{ "lewis6991/gitsigns.nvim", lazy = false, opts = require("config.plugins.gitsigns") },
6-
{ "willothy/flatten.nvim", lazy = false, opts = require("config.plugins.flatten"), priority = 1000, },
6+
{ "dk949/flatten.nvim", lazy = false, opts = require("config.plugins.flatten"), priority = 1000, },
77
{ "godlygeek/tabular", lazy = true, cmd = "Tabularize" },
88
{ "tpope/vim-surround", lazy = false, },
99
}

lua/utils/ui.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ local M = {}
55
---@param cmd string|string[]
66
---@param opts {relsize: number?}?
77
function M.runInTerm(cmd, opts)
8-
require("flatten").config.window.open = "current"
98
if not opts then opts = {} end
109
if not opts.relsize then opts.relsize = 0.75 end
1110
local buf = vim.api.nvim_create_buf(false, true)

0 commit comments

Comments
 (0)