Skip to content

BUG: focus_next_git_modified considers untracked files #1840

@notEvil

Description

@notEvil

Did you check docs and existing issues?

  • I have read all the docs.
  • I have searched the existing issues.
  • I have searched the existing discussions.

Neovim Version (nvim -v)

NVIM v0.11.3

Operating System / Version

Arch Linux

Describe the Bug

Hi,

focus_next_git_modified which powers next_git_modified and prev_git_modified uses status ~= "!!"

if path ~= current_path and status and status ~= "!!" then

Untracked files have status == "?" and are therefore valid targets for these moves.

Screenshots, Traceback

No response

Steps to Reproduce

  1. Make sure there are untracked files
  2. Put cursor on tracked file before untracked file
  3. Move to next modified file, by default ]g

Expected Behavior

neo-tree skips untracked files

Your Configuration

-- template from https://lazy.folke.io/developers#reprolua, feel free to replace if you have your own minimal init.lua
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 = {
    {
      "nvim-neo-tree/neo-tree.nvim",
      branch = "v3.x", -- or "main"
      dependencies = {
        "nvim-lua/plenary.nvim",
        "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
        "MunifTanjim/nui.nvim",
        -- { "3rd/image.nvim", opts = {} }, -- Optional image support
      },
      lazy = false,
      ---@module "neo-tree"
      ---@type neotree.Config?
      opts = {
        -- fill any relevant options here
      },
    }
  },
})
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>e", "<Cmd>Neotree<CR>")
-- do anything else you need to do to reproduce the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions