Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dirman: creating new note does not put current note into jumplist #1670

Open
2 tasks done
sij1nk opened this issue Mar 22, 2025 · 1 comment
Open
2 tasks done

dirman: creating new note does not put current note into jumplist #1670

sij1nk opened this issue Mar 22, 2025 · 1 comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@sij1nk
Copy link

sij1nk commented Mar 22, 2025

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.10.4 Build type: RelWithDebInfo LuaJIT 2.1.1736781742

Neorg setup

      require("neorg").setup({
        load = {
          ["core.defaults"] = {
            config = {
              disable = {
                "core.todo-introspector",
              },
            },
          }, -- Loads default behaviour
          ["core.completion"] = {
            config = { engine = { module_name = "external.lsp-completion" } },
          },
          ["core.concealer"] = {
            config = {
              icon_preset = "diamond",
              icons = {
                code_block = {
                  conceal = true,
                },
              },
            },
          }, -- Adds pretty icons to your documents
          ["core.dirman"] = { -- Manages Neorg workspaces
            config = {
              workspaces = {
                notes = notes_path,
                worknotes = worknotes_path,
              },
              default_workspace = "notes",
            },
          },
          ["core.export"] = {
            config = {
              export_dir = "<export-dir>/<language>-export",
            },
          },
          ["core.export.markdown"] = {
            config = {
              extensions = "all",
            },
          },
          ["core.ui.calendar"] = {},
          ["core.esupports.metagen"] = {
            config = {
              type = "auto",
              -- TODO: include weekday name (%A)
            },
          },
          ["external.conceal-wrap"] = {},
          ["external.many-mans"] = {
            config = {
              metadata_fold = true, -- If want @data property ... @end to fold
              code_fold = true, -- If want @code ... @end to fold
            },
          },
          ["external.roam"] = {
            config = {
              fuzzy_finder = "Snacks", -- OR "Fzf" OR "Snacks". Defaults to "Telescope"
              fuzzy_backlinks = true, -- Set to "true" for backlinks in fuzzy finder instead of buffer
              roam_base_directory = "", -- Directory in current workspace to store roam nodes
              node_name_randomiser = false, -- Tokenise node name suffix for more randomisation
              node_name_snake_case = false, -- snake_case the names if node_name_randomiser = false
            },
          },
          ["external.interim-ls"] = {},
        },
      })

Actual behavior

In a new neovim instance, I opened these notes in this order:

  • index.norg
  • Notes/dbus.norg
  • Notes/android-file-transfer.norg
  • Notes/pipewire.norg

My jumplist then looked like this:

Image

At this, point, I create a new note bleh using the default <localleader>nn binding.

Image

The jump list did not change. If I now go jump back using C-o, I get brought back to Notes/android-file-transfer.norg

Tested on neorg v9.2.0 and on latest (6f0b4ee)

Expected behavior

In the example above, I'd expect C-o to bring me back to Notes/pipewire.neorg, to the location I was in when creating the new note

Steps to reproduce

  • open a bunch of notes
  • create new note using dirman (<localleader>nn)
  • jump back (C-o)

Potentially conflicting plugins

don't think there's a conflict, but I didn't really check

Other information

Neorg module list:

- `core.dirman.utils`
- `core.integrations.treesitter`
- `core.links`
- `external.interim-ls`
- `external.roam`
- `core.concealer.preset_diamond`
- `core.neorgcmd.commands.return`
- `external.refactor`
- `core.autocommands`
- `core.ui`
- `core.storage`
- `core.esupports.metagen`
- `core.ui.calendar`
- `core.export.markdown`
- `core.export`
- `core.promo`
- `core.pivot`
- `core.dirman`
- `core.keybinds`
- `core.neorgcmd`
- `core.itero`
- `core.esupports.indent`
- `core.esupports.hop`
- `core.clipboard.code-blocks`
- `core.clipboard`
- `core.completion`
- `external.lsp-completion`
- `core.defaults`
- `core.concealer.preset_varied`
- `external.many-mans`
- `core.concealer`
- `core.concealer.preset_basic`
- `core.tangle`
- `core.qol.todo_items`
- `core.ui.selection_popup`
- `core.qol.toc`
- `core.ui.calendar.views.monthly`
- `core.tempus`
- `core.ui.text_popup`
- `core.highlights`
- `external.conceal-wrap`
- `core.journal`
- `core.looking-glass`

my neorg.log contains no log entries from recent days

Help

Yes

Implementation help

(it might take me some time though)

@sij1nk sij1nk added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Mar 22, 2025
@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker Mar 22, 2025
@benlubas
Copy link
Contributor

buried in :h jumplist if this line that should be helpful

You can explicitly add a jump by setting the ' mark with "m'".

And here is the part of the neorg codebase where the new note function is defined: https://github.com/benlubas/neorg/blob/01ea652663cdacd7e0187ff234eaee65b613e51a/lua/neorg/modules/core/dirman/module.lua#L463

Something that might be tricky: adding to the jumplist only if the note is created, and not adding to the jumplist if the user opens the new note popup and then closes the window.

lmk if you want any other help with this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

2 participants