diff --git a/flake.lock b/flake.lock index f7bb4eb..6e5f8e8 100644 --- a/flake.lock +++ b/flake.lock @@ -6,17 +6,14 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1760745932, - "narHash": "sha256-Z9idyP9kiKxC10VL0vHnxcBwrkpNtBrC+Zxl9mQbCj8=", - "owner": "iofq", - "repo": "dart.nvim", - "rev": "26b476f2113143329637a27d4e52ce9772bcae5b", - "type": "github" + "lastModified": 1760318820, + "narHash": "sha256-3ETm+AZ/UEU0OYFSYviMSv/Ov4BN1cEsBH6KNGuTYS4=", + "path": "/home/e/dev/dart.nvim", + "type": "path" }, "original": { - "owner": "iofq", - "repo": "dart.nvim", - "type": "github" + "path": "/home/e/dev/dart.nvim", + "type": "path" } }, "flake-compat": { @@ -93,11 +90,11 @@ ] }, "locked": { - "lastModified": 1760813311, - "narHash": "sha256-lbHQ7FXGzt6/IygWvJ1lCq+Txcut3xYYd6VIpF1ojkg=", + "lastModified": 1759362264, + "narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "4e627ac2e1b8f1de7f5090064242de9a259dbbc8", + "rev": "758cf7296bee11f1706a574c77d072b8a7baa881", "type": "github" }, "original": { @@ -198,11 +195,11 @@ ] }, "locked": { - "lastModified": 1760663237, - "narHash": "sha256-BflA6U4AM1bzuRMR8QqzPXqh8sWVCNDzOdsxXEguJIc=", + "lastModified": 1759523803, + "narHash": "sha256-PTod9NG+i3XbbnBKMl/e5uHDBYpwIWivQ3gOWSEuIEM=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37", + "rev": "cfc9f7bb163ad8542029d303e599c0f7eee09835", "type": "github" }, "original": { @@ -309,11 +306,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1760832323, - "narHash": "sha256-THAk4qzBOsp03bDBYK9Ek3mQEvl2g8Fea0QhpCoEzfs=", + "lastModified": 1760313895, + "narHash": "sha256-39JFRb006AOsIcOq+03H3y6YcGyaphk1CW5DRi14cOE=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "3c9432813e5528a13075f5493da6ff9ef249ad1d", + "rev": "7ff73a295b0065bde2f8b43b31558136ca77bd98", "type": "github" }, "original": { @@ -325,11 +322,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1760810839, - "narHash": "sha256-VYkZdjjMOYsugoSydDDWE/1l79swm4zc4NJl1Z0brjA=", + "lastModified": 1760312166, + "narHash": "sha256-RnB+oJcP37YT9pjr1osUQtJc+1qcVyaaeSbiSyXwm1Y=", "owner": "neovim", "repo": "neovim", - "rev": "be73c35943f85e7835c3a0fc89bddaeba944db29", + "rev": "72b0bfa1fb7e897e5126aabae718a5480f466b9e", "type": "github" }, "original": { @@ -383,11 +380,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1760913523, - "narHash": "sha256-Il5+67iRA3xp0cIErILj4VwEJ2ICrDrvTAHEmBsZJKQ=", + "lastModified": 1760326837, + "narHash": "sha256-z+C6KRPRjwqEsTEAwUavapBWcbR7YOlQP91O+W5L1ek=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6a3b08503e9cab108f9f0ec27065c5854655662a", + "rev": "cfe6b045750c3aa5127817bc3f44f2909b1ee175", "type": "github" }, "original": { @@ -399,11 +396,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1760524057, - "narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=", + "lastModified": 1760038930, + "narHash": "sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5", + "rev": "0b4defa2584313f3b781240b29d61f6f9f7e0df3", "type": "github" }, "original": { @@ -416,11 +413,11 @@ "nvim-treesitter": { "flake": false, "locked": { - "lastModified": 1760866486, - "narHash": "sha256-ZeNCXy6+I18N+Nu2sKnEk2otVEb8V3tKhL8Jq95wS5k=", + "lastModified": 1760260935, + "narHash": "sha256-To/syCZPs7vKA0WkuBz7ZxCGT/wzj705QfxZng6Nsjo=", "owner": "nvim-treesitter", "repo": "nvim-treesitter", - "rev": "71bf1665f804d46f7e4b24ad7ffc11f6ea5b271a", + "rev": "0606c7a9dcaa5c5beee0b0f09043e9fdd1ba0a68", "type": "github" }, "original": { @@ -437,11 +434,11 @@ "nvim-treesitter-textobjects": "nvim-treesitter-textobjects" }, "locked": { - "lastModified": 1760906917, - "narHash": "sha256-WJScDX0q/+PCRpvBSlJfV01kwvu9WCk5YDpzW2Zswj8=", + "lastModified": 1760324917, + "narHash": "sha256-ZlVGaUbxHf4DNR4GWhF1mvlMhP8IBbwF0g8WO1SL+Yw=", "owner": "iofq", "repo": "nvim-treesitter-main", - "rev": "420c14c0523d65c6c7ce943e8f2fb896eff950e3", + "rev": "da2262419eb66cfa426aa62ccf1fc8fdea33b4a0", "type": "github" }, "original": { @@ -515,11 +512,11 @@ ] }, "locked": { - "lastModified": 1760802554, - "narHash": "sha256-5YkOYOCF8/XNw89/ABKFB0c/P78U2EVuKRDGTql6+kA=", + "lastModified": 1760120816, + "narHash": "sha256-gq9rdocpmRZCwLS5vsHozwB6b5nrOBDNc2kkEaTXHfg=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "296ebf0c3668ebceb3b0bfee55298f112b4b5754", + "rev": "761ae7aff00907b607125b2f57338b74177697ed", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a9cc1ad..ed8d02c 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; dart = { - url = "github:iofq/dart.nvim"; + url = "path:/home/e/dev/dart.nvim"; }; nvim-treesitter-main = { url = "github:iofq/nvim-treesitter-main"; diff --git a/new b/new deleted file mode 100644 index fab9518..0000000 --- a/new +++ /dev/null @@ -1 +0,0 @@ -print('kjsnadf') diff --git a/nvim/after/lua/iofq/snacks_jj.lua b/nvim/after/lua/iofq/snacks_jj.lua index aae14fa..639ecfd 100644 --- a/nvim/after/lua/iofq/snacks_jj.lua +++ b/nvim/after/lua/iofq/snacks_jj.lua @@ -49,42 +49,4 @@ function M.status() } end -function M.file_history(filename) - local function preview(ctx) - if ctx.item.rev then - Snacks.picker.preview.cmd( - { 'jj', 'log', '--ignore-working-copy', '--git', '-r', ctx.item.rev, '-p', filename }, - ctx - ) - else - ctx.preview:reset() - return 'No preview available.' - end - end - - local function get_history(f) - local status_raw = vim.fn.system( - 'jj log --ignore-working-copy --no-graph' - .. ' --template \'if(root, format_root_commit(self), label(if(current_working_copy, "working_copy"), concat(separate(" ", self.change_id().shortest(8), self.bookmarks()), " | ", if(empty, label("empty", "(empty)")), if(description, description.first_line(), label(if(empty, "empty"), description_placeholder),),) ++ "\n",),)\'' - .. ' -- ' - .. f - ) - local lines = {} - for line in status_raw:gmatch('[^\r\n]+') do - local rev = string.match(line, '(%w+)%s.*') - table.insert(lines, { - text = line, - rev = rev, - }) - end - return lines - end - - Snacks.picker.pick { - format = 'text', - title = 'jj file history for ' .. filename, - items = get_history(filename), - preview = preview, - } -end return M diff --git a/nvim/after/plugin/autocmd.lua b/nvim/after/plugin/autocmd.lua index 7498f6d..18af3e9 100644 --- a/nvim/after/plugin/autocmd.lua +++ b/nvim/after/plugin/autocmd.lua @@ -35,13 +35,13 @@ vim.api.nvim_create_autocmd('FileType', { group = vim.api.nvim_create_augroup('difftool', { clear = true }), callback = function(event) local function exec(fmt, str) - return os.execute(string.format(fmt, str)) + os.execute(string.format(fmt, str)) end local function refresh() local qf = vim.fn.getqflist() local entry = qf[1] - if not entry or not entry.user_data or not entry.user_data.diff then + if not entry or not entry.user_data.diff then return nil end diff --git a/nvim/after/plugin/plugins.lua b/nvim/after/plugin/plugins.lua index 97feed3..58dae3e 100644 --- a/nvim/after/plugin/plugins.lua +++ b/nvim/after/plugin/plugins.lua @@ -56,9 +56,6 @@ map('n', 'f.', Snacks.picker.resume) map('n', 'fb', Snacks.picker.buffers) map('n', 'fq', Snacks.picker.qflist) map('n', 'jf', require('iofq.snacks_jj').status) -map('n', 'jh', function() - require('iofq.snacks_jj').file_history(vim.api.nvim_buf_get_name(0)) -end) vim.schedule(function() require('nvim-treesitter').setup()