| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ local function _dart_sdk_root(paths) | |||
| 27 | 27 | if path.is_dir(path.join(unpack(segments))) then | |
| 28 | 28 | -- remove the /cache/ directory as it's already part of the SDK path above | |
| 29 | 29 | segments[#segments] = nil | |
| 30 | - return path.join(unpack(vim.tbl_flatten({ segments, dart_sdk }))) | ||
| 30 | + return path.join(unpack(utils.flatten({ segments, dart_sdk }))) | ||
| 31 | 31 | end | |
| 32 | 32 | end | |
| 33 | 33 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -143,5 +143,7 @@ end | |||
| 143 | 143 | ||
| 144 | 144 | -- TODO: Remove after compatibility with Neovim=0.9 is dropped | |
| 145 | 145 | M.islist = vim.fn.has("nvim-0.10") == 1 and vim.islist or vim.tbl_islist | |
| 146 | + local flatten = function(t) return vim.iter(t):flatten():totable() end | ||
| 147 | + M.flatten = vim.fn.has("nvim-0.10") == 1 and flatten or vim.tbl_flatten | ||
| 146 | 148 | ||
| 147 | 149 | return M | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,6 @@ | |||
| 1 | 1 | -- Some path utilities, copied from nvim-lsp config | |
| 2 | + local lazy = require("flutter-tools.lazy") | ||
| 3 | + local utils = lazy.require("flutter-tools.utils") ---@module "flutter-tools.utils" | ||
| 2 | 4 | ||
| 3 | 5 | local luv = vim.loop | |
| 4 | 6 | local M = {} | |
@@ -51,7 +53,7 @@ end | |||
| 51 | 53 | ---@return string | |
| 52 | 54 | function M.join(...) | |
| 53 | 55 | local result = | |
| 54 | - table.concat(vim.tbl_flatten({ ... }), M.path_sep):gsub(M.path_sep .. "+", M.path_sep) | ||
| 56 | + table.concat(utils.flatten({ ... }), M.path_sep):gsub(M.path_sep .. "+", M.path_sep) | ||
| 55 | 57 | return result | |
| 56 | 58 | end | |
| 57 | 59 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments