Skip to content

The previous/next actions don't work correctly when the current buffer is a spread #2

@tllilleh

Description

@tllilleh

Here is a minimal bujo-init.lua to reproduce the issue:

vim.g.mapleader = " "

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
    spec = {
        {
            "timhugh/bujo.nvim",
            dependencies = {
                "nvim-telescope/telescope.nvim",
                "leafo/etlua",
                "michaelb/sniprun",
            },
            opts = {
                spreads = {
                    weekly = {
                        filename_template = "%Y/W%V",
                        now_keybind = "<leader>nw",
                        next_keybind = "<leader>nf",
                        previous_keybind = "<leader>nb",
                    },
                },
            },
        },
    },
})

To test I run: nvim -u bujo-init.lua

From a normal buffer all three of these actions work as expected.

However, if I run <leader>nw to open the current week's spread (currently ~/.bujo/2025/W34.md) and then run <leader>nb while the spread is open it opens ~/.bujo/2024/W01.md instead of the expected ~/.bujo/2025/W33.md). If I run <leader>nf from the current week's spread it opens ~/.bujo/2025/W02.md instead of the expected ~/.bujo/2025/W35.md.

System Info:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy
$ nvim --version
NVIM v0.11.3
Build type: Release
LuaJIT 2.1.1741730670
Run "nvim -V1 -v" for more info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions