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 functions don't support windows #241

Closed
3 tasks done
elmarsto opened this issue Dec 14, 2021 · 7 comments
Closed
3 tasks done

dirman functions don't support windows #241

elmarsto opened this issue Dec 14, 2021 · 7 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label. module: existing modules Issue related to existing Modules

Comments

@elmarsto
Copy link

elmarsto commented Dec 14, 2021

Prerequisites

  • I have read contribution guidelines
  • I am using the latest version of the plugin
  • I am using either 0.6 stable or the latest compiled neovim version

Neovim Version

PS C:\Users\1atti> nvim --version
NVIM v0.6.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compiled by runneradmin@fv-az152-703

Features: -acl +iconv +tui
See ":help feature-compile"

system vimrc file: "$VIM\sysinit.vim"
fall-back for $VIM: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info
PS C:\Users\1atti>

Loaded modules

Check out https://github.com/elmarsto/nvim-config/ for the full config
core.norg.completion
core.ui.selection_popup
core.norg.dirman
core.mode
core.norg.qol.todo_items
core.norg.esupports
core.norg.esupports.metagen
core.norg.esupports.hop
core.ui
core.norg.manoeuvre
core.gtd.queries.helpers
core.gtd.queries
core.queries.native
core.neorgcmd.commands.module.load
core.neorgcmd.commands.return
core.scanner
core.gtd.ui.selection_popups
core.highlights
core.ui.text_popup
core.integrations.telescope
core.gtd.ui.displayers
core.gtd.ui.views_popup_helpers
core.gtd.ui.edit_popup_helpers
core.gtd.queries.modifiers
core.gtd.queries.creators
core.gtd.ui
core.norg.concealer.preset_varied
core.gtd.queries.retrievers
core.norg.concealer.preset_basic
core.autocommands
core.neorgcmd
core.norg.concealer.preset_diamond
core.integrations.treesitter
core.storage
core.defaults
core.norg.concealer
core.gtd.base
core.integrations.nvim-cmp
core.neorgcmd.commands.module.list
core.keybinds
core.keybinds.default_keybinds
core.norg.news

Actual behavior

The error is:

:Neorg gtd capture
:messages
[neorg] [ERROR 18:41:42] ...rg/lua/neorg/modules/core/gtd/ui/views_popup_helpers.lua:449:  Inbox file is not from gtd workspace.
[neorg]                             Please verify if the file exists in your gtd workspace.
[neorg]                             Type :messages to show the full error report
[neorg]

Expected behavior

:Neorg gtd capture should work as it does under Linux, where I also run this config (with different paths in my lattice_local).

Steps to reproduce

    use {
      "nvim-neorg/neorg",
      requires = "nvim-neorg/neorg-telescope",
      config = function()
        local ll = require "lattice_local"
        require("neorg").setup {
          load = {
            ["core.defaults"] = {},
            ["core.norg.concealer"] = {},
            ["core.gtd.base"] = {
              config = {
                workspace = ll.neorg.gtd
              }
            },
            ["core.keybinds"] = {
              config = {
                default_keybinds = true,
                neorg_leader = "<Leader>o"
              }
            },
            ["core.norg.completion"] = {
              config = {
                engine = "nvim-cmp"
              }
            },
            ["core.integrations.telescope"] = {},
            ["core.norg.dirman"] = {
              config = {
                workspaces = ll.neorg.workspaces
              }
            }
          }
        }
        -- https://github.com/nvim-neorg/neorg/wiki/User-Keybinds
        local neorg_callbacks = require("neorg.callbacks")
        neorg_callbacks.on_event(
          "core.keybinds.events.enable_keybinds",
          function(_, keybinds)
            keybinds.map_event_to_mode(
              "norg",
              {
                n = {
                  {"gtd", "core.norg.qol.todo_items.todo.task_done"},
                  {"gtu", "core.norg.qol.todo_items.todo.task_undone"},
                  {"gtp", "core.norg.qol.todo_items.todo.task_pending"},
                  {"<C-Space>", "core.norg.qol.todo_items.todo.task_cycle"}
                }
              },
              {silent = true, noremap = true}
            )
          end
        )
      end
    }

And then the relevant part of lattice_local is:

   neorg = {
    workspaces = {
        workvault = "E:/OneDrive/OneDrive - Microsoft/Workvault/",
        gtd  = "E:/OneDrive/OneDrive - Microsoft/Workvault/gtd/",
    },
    gtd = "gtd",
   },

I've also tried it with all the different combinations I could think of:

  • relative path
  • escaped backslashes intead of slashes
  • gtd workspace on its own, at E:/gtd
  • relative path for gtd workspace
  • ...and lots more besides ;)

FWIW I also have this inbox.norg:

PS E:\OneDrive\OneDrive - Microsoft\Workvault\gtd> cat .\inbox.norg
@document.meta
  title: inbox
  description:
  authors: foo
  categories:
  created: 2021-12-13
  version: 0.0.8
@end

PS E:\OneDrive\OneDrive - Microsoft\Workvault\gtd>

Potentially conflicting plugins

I actually have no guess, I'm a neorg newb

Other information

I've tried fiddling with fileformat, directory names, forward slashes, backward slashes, putting /gtd outside in a separate workspace at the root of my filesystem, trailing slash, no trailing slash, etc.

FWIW everything else in Neorg seems to work, e.g. :Neorg workspace gtd.

Help

Not at this time

Implementation help

More time in my day :)

@elmarsto elmarsto added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Dec 14, 2021
@danymat
Copy link
Member

danymat commented Dec 14, 2021

Uh !

Indeed it seems that most (if not all) dirman (module for handling files and directories) functions are only linux coherent...

Can you try out the link format and tell me if it works for you ?

@elmarsto
Copy link
Author

elmarsto commented Dec 14, 2021

Yesterday was my first taste of the GTD module. I did not get a chance to play with the new link format, but anecdotally, everything has worked pretty good for a bit.

My setup is that I run a NixOS host with a Win10 VM via kvm/qemu/spice stack, so I go back and forth constantly and have identical git-versioned configs under both systems. It's trivial for me to compare specific scenarios, if you'd like me to.

It would be unfortunate if a tool for Getting Things Done did not actually permit one to get things done on the OS one is required to use for work :D

@danymat danymat changed the title GTD module broken under Windows birman functions don't support windows Dec 14, 2021
@danymat danymat changed the title birman functions don't support windows dirman functions don't support windows Dec 14, 2021
@danymat
Copy link
Member

danymat commented Dec 14, 2021

@vhyrro I just found out that dirman functions don't support Windows !

It messes up with gtd, but not only: creating recursive notes with Leader .. nn too.

The functions that need to be changed:

  • create_file
  • open_file
  • get_norg_file ?
  • open_workspace ?

@danymat danymat added module: existing modules Issue related to existing Modules and removed GTD module labels Dec 14, 2021
@danymat danymat modified the milestone: 0.1 Dec 14, 2021
@danymat danymat removed their assignment Dec 14, 2021
@vhyrro
Copy link
Member

vhyrro commented Dec 16, 2021

I just tried pushing a basic fix. I hope I didn't accidentally break Neorg for several people lmao

If you could try it out and let me know whether it works that'd be sweet :)

@elmarsto
Copy link
Author

elmarsto commented Dec 17, 2021

Confirmed working at my end. Thank you, @vhyrro and @danymat, for making my day. <3

@vhyrro
Copy link
Member

vhyrro commented Dec 18, 2021

Awesome! I'll wait for at least one more person to confirm stuff works and then I'll close the issue

@vhyrro
Copy link
Member

vhyrro commented Dec 19, 2021

So far seems like all's good! Will close the issue then, and if any other problems arise we can reopen 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. module: existing modules Issue related to existing Modules
Projects
None yet
Development

No branches or pull requests

3 participants