repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: fix `std.project` on windows

646cc301e5c290e97dfe2024f486dcdec9ea0fa6

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

normalizes path names so that inconsistencies between `/` and `\` get
resolved.

Changed files (3)

neovim/init.lua

Modified
17 17 require 'bugabinga.lsp'
19 19 -- TODO:
20 --- [ ] use neodev
21 --- [ ] add nu-check to nvim-lint
22 20 -- [ ] use ltex-ls for markdown, code comments and commit messages
23 21 -- [ ] use nvimjdtls
24 22 -- [ ] DAP
25 23 -- [ ] nugu theme
24 +-- [ ] add nu-check to nvim-lint
27 26 -- PLUGINS TO TRY
28 27 -- https://github.com/ThePrimeagen/refactoring.nvim

neovim/lazy-lock.json

Modified
7 7 "glow.nvim": { "branch": "main", "commit": "cf2177a514859fa3c55837b46de91d93b24cf488" },
8 8 "heirline.nvim": { "branch": "master", "commit": "76136ccd93ed608e8109762f032cf1118981ebbd" },
9 9 "hlargs.nvim": { "branch": "main", "commit": "cfc9beab4e176a13311efe03e38e6b6fed5df4f6" },
10 - "indent-blankline.nvim": { "branch": "master", "commit": "73640233cca0da8e01aced8c1f9e63fd892128b7" },
11 - "lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
10 + "indent-blankline.nvim": { "branch": "master", "commit": "b7aa0aed55887edfaece23f7b46ab22232fc8741" },
11 + "lazy.nvim": { "branch": "main", "commit": "14d76aac4bd3ff07c1fca074c210f28f766a931e" },
12 12 "lush.nvim": { "branch": "main", "commit": "b10ef2bfff0647e701b691019ade3edd5e44eb50" },
13 13 "neodev.nvim": { "branch": "main", "commit": "da1562e1e3df0e994ddc52cb4ba22376a5d7f2fc" },
14 14 "neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
15 - "noice.nvim": { "branch": "main", "commit": "bae49f5e0615cfffde271d4bec50376d770a15d3" },
15 + "noice.nvim": { "branch": "main", "commit": "40d670ef8935af3bf5df44ca27d83dcf1d75f0fd" },
16 16 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
17 - "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" },
17 + "nui.nvim": { "branch": "main", "commit": "7a524120a7a70761b5a65b602fd235a65cb005aa" },
18 18 "nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" },
19 19 "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" },
20 20 "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
23 23 "nvim-lastplace": { "branch": "main", "commit": "aeb0e0bd399288092729da89a9e51dda4ccbc9ec" },
24 24 "nvim-neoclip.lua": { "branch": "main", "commit": "4e406ae0f759262518731538f2585abb9d269bac" },
25 25 "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" },
26 + "nvim-spectre": { "branch": "master", "commit": "be7ff1d29ddf2de59b3dc293988d110c2c00ac84" },
26 27 "nvim-surround": { "branch": "main", "commit": "211eaad7c6d01ef4ac02cba9052b3082ec232101" },
27 - "nvim-treesitter": { "branch": "master", "commit": "7b04e8b67eec7d92daadf9f0717dd272ddfc81a3" },
28 + "nvim-treesitter": { "branch": "master", "commit": "9fa6806b88905d52b5ca36094909630919b432cc" },
28 29 "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
29 30 "nvim-ts-context-commentstring": { "branch": "main", "commit": "7f625207f225eea97ef7a6abe7611e556c396d2f" },
30 31 "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" },
32 33 "persistence.nvim": { "branch": "main", "commit": "adcf6913693a0434665d162ee45a186230496f8a" },
33 34 "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" },
34 35 "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
35 - "refactoring.nvim": { "branch": "master", "commit": "7d57e01a9ae012c7aedd73f518d45608a772eb1f" },
36 + "refactoring.nvim": { "branch": "master", "commit": "7894b10078a1a70c9b26028f4373bf209968e9bc" },
36 37 "specs.nvim": { "branch": "main", "commit": "2743e412bbe21c9d73954c403d01e8de7377890d" },
37 38 "substitute.nvim": { "branch": "main", "commit": "42d09f1e6324d98aa2e5b765b64528e0aefe72b0" },
38 39 "telescope-symbols.nvim": { "branch": "master", "commit": "f2060117d965df4a626f068a4ebbd8ee051aa076" },

neovim/lua/std/project.lua

Modified
1 1 local join = require'std.table'.join
2 2 local dirname = vim.fs.dirname
3 +local normalize = vim.fs.normalize
3 4 local exists = vim.loop.fs_stat
5 +local validate = vim.validate
5 7 --- number of max loop iterations when searching for markers
6 8 local MAX_TRAVERSAL_COUNT = 100
36 38 ---directory is used.
37 39 ---@return string? # Directory, that contains the `markers` and lies on the path from `path` to `stop`.
38 40 local function find_root(path, markers, stop)
39 - path = path or dirname(vim.api.nvim_buf_get_name(0))
40 - stop = stop or vim.uv.os_homedir()
42 - --FIXME:: vim.validate
42 + validate{
43 + path = { path, 'string', true },
44 + markers = { markers, 'table'},
45 + stop = { stop, 'string', true},
46 + }
48 + path = path or dirname(vim.api.nvim_buf_get_name(0))
49 + path = normalize(path)
50 + stop = stop or vim.uv.os_homedir()
51 + stop = normalize(stop)
44 53 if not exists(stop) then error( ( 'the stop directory %s does not exist!' ):format(stop) ) end