From eec43aaccb3222c838091ac4eb8f8780d921d4cc Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Fri, 22 Jan 2021 15:57:13 -0500 Subject: `io.get_project_root()` accepts an optional flag for returning a submodule root. This is for systems like git that have '.git' files (not directories) for submodules under a parent '.git' directory. --- docs/api.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/api.md b/docs/api.md index 7d225a0d..a0a9b2b3 100644 --- a/docs/api.md +++ b/docs/api.md @@ -4376,7 +4376,7 @@ See also: * [`buffer.close`](#buffer.close) -#### `io.get_project_root`(*path*) +#### `io.get_project_root`(*path, submodule*) Returns the root directory of the project that contains filesystem path *path*. @@ -4387,7 +4387,10 @@ Parameters: * *`path`*: Optional filesystem path to a project or a file contained within a project. The default value is the buffer's filename or the current - working directory. + working directory. This parameter may be omitted. +* *`submodule`*: Optional flag that indicates whether or not to return the + root of the current submodule (if applicable). The default value is + `false`. Return: -- cgit v1.2.3