Skip to content

bug: close_if_last_window bypasses "E37: No write since last change" on quit attempt #277

@Minitajfun

Description

@Minitajfun

Did you read the documentation and check existing issues?

Neovim version (nvim -v)

0.11.6

Operating system/version

Arch Linux

Describe the bug

When the 'layout' is set to 'split' and 'close_if_last_window' to true, as long as the minimap is enabled closing the last file while there are unwritten changes does not yield the expected E37: No write since last change.

Instead, the program is outright quit, and the changes to the files are lost.

Steps To Reproduce

  1. Install the plugin
  2. Set 'layout' to 'split' and 'close_if_last_window' to 'true' in the config
  3. Open any file(s)
  4. Make sure minimap is enabled
  5. Edit any file(s)
  6. Close the file(s) without writing the changes
  7. NeoVim now exits without showing E37

Expected Behavior

E37: No write since last change should be displayed when trying to quit NeoVim with unwritten changes.

Health

neominimap:                                                               2 ⚠️

- ✅ OK Neovim version is 0.10 or higher
- ✅ OK neominimap: valid config
- TreeSitter integration is enabled
- ⚠️ WARNING TreeSitter is not installed
- Gitsigns integration is enabled
- ⚠️ WARNING Gitsigns is not installed
- MiniDiff integration is disabled

Log


Repro

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 = {
    {
      {
        "Isrothy/neominimap.nvim",
        init = function()
          vim.g.neominimap = {
            layout = "split",
            split = {
              close_if_last_window = true,
            },
            log_level = vim.log.levels.TRACE,
          }
        end,
      },
    },
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions