Skip to content

oil.nvim incompatibilities, an issue with conceal & forced cursor positioning? #140

@bew

Description

@bew

Hello!

I noticed an issue with oil.nvim when trying to go to the beginning of the line, Oil will force re-position the main cursor but not the other cursors.

With this `repro.lua` neovim config
---@diagnostic disable: missing-fields, unused-local

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

vim.keymap.set("n", "Q", function() vim.cmd[[quit]] end, {desc="Quit neovim o/"})

-- Example minimal config for `multicursor.nvim`
local plugin_specs = {
  {
    "stevearc/oil.nvim",
    config = function()
      require"oil".setup()
    end,
  },
  {
    "jake-stewart/multicursor.nvim",
    config = function()
      local mc = require"multicursor-nvim"
      mc.setup()
      vim.api.nvim_set_hl(0, "MultiCursorCursor", { reverse = true })
      vim.api.nvim_set_hl(0, "MultiCursorVisual", { link = "Visual" })
      vim.api.nvim_set_hl(0, "MultiCursorMatchPreview", { link = "Search" })

      vim.keymap.set({"n", "x"}, "<M-Space><M-j>", function() mc.lineAddCursor(1) end, {desc="Add cursor below"})
      vim.keymap.set({"n", "x"}, "<M-Space>n", function() mc.matchAddCursor(1) end, {desc="Add cursor on next match"})
      vim.keymap.set("n", "<M-Space><M-esc>", function() mc.clearCursors() end, {desc="Clear all cursors"})
    end,
  },
}

require"lazy.minit".repro { spec = plugin_specs }

Repro steps

  1. Run nvim -u repro.lua lua/multicursor-nvim/
  2. Place a few cursors using lineAddCursor(1)
  3. Hit ^ to go the beginning of the line
  4. See that only the main cursor stays visible, they are in fact hidden in the sort of 'virtual gutter' that Oil makes with conceal as moving them all to the rights makes them visible again.
Screen.Recording.2025-11-18.at.14.35.11.mov

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