From ec7ab0f90f2732a942eac6e02241d5658daa4b26 Mon Sep 17 00:00:00 2001 From: dk949 <56653556+dk949@users.noreply.github.com> Date: Wed, 23 Jul 2025 02:59:46 +0100 Subject: [PATCH 1/2] fix(core)!: changed the order expected from `open` This is inline with documentation and the way `diff` expects it's return values. This is a breaking change, however, I think it will mostly affect hooks, not the core functionality. Namely this will change the value passed for `winnr` to `post_open` and may cause `block_end` to not be called. This also only people who were using `open` as a function, rather than a string, and have already swapped the two values. --- lua/flatten/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/flatten/core.lua b/lua/flatten/core.lua index e7388d3..3082beb 100644 --- a/lua/flatten/core.lua +++ b/lua/flatten/core.lua @@ -279,7 +279,7 @@ function M.edit_files(opts) winnr = winnr or vim.api.nvim_get_current_win() bufnr = bufnr or vim.api.nvim_get_current_buf() elseif type(open) == "function" then - bufnr, winnr = open({ + winnr, bufnr = open({ files = files, argv = argv, stdin_buf = stdin_buf, From 76b6e06a8b9a90307e8679f0894c74ae53bb92db Mon Sep 17 00:00:00 2001 From: dk949 <56653556+dk949@users.noreply.github.com> Date: Wed, 23 Jul 2025 03:10:43 +0100 Subject: [PATCH 2/2] docs(readme): updated type of `files` in README It was previously stated as `string[]`, but the actual type passed to `open` is `Flatten.BufInfo[]`. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 80846ef..a220adc 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ local config = { - A custom function that returns a window number and optionally a buffer. - `Flatten.OpenContext`: - - `files`: `string[]` + - `files`: `Flatten.BufInfo[]` - The list of files passed to the host. - `argv`: `string[]` - The full argv list from the *guest* instance.