From 95811803fd79f52417504d51555b85a10536b580 Mon Sep 17 00:00:00 2001 From: Caleb Larsen Date: Fri, 13 Jun 2025 15:31:52 -0500 Subject: [PATCH] Docs: Added docs to helix-stdx, helix-tui, helix-vcs --- helix-stdx/src/env.rs | 11 ++++++++--- helix-stdx/src/faccess.rs | 1 + helix-stdx/src/lib.rs | 3 +++ helix-stdx/src/path.rs | 3 +++ helix-stdx/src/range.rs | 3 +++ helix-stdx/src/rope.rs | 2 ++ helix-tui/src/backend/crossterm.rs | 1 + helix-tui/src/backend/mod.rs | 15 +++++++++++++++ helix-tui/src/buffer.rs | 17 ++++++++++++++++- helix-tui/src/layout.rs | 12 ++++++++++++ helix-tui/src/symbols.rs | 2 ++ helix-tui/src/terminal.rs | 6 +++++- helix-tui/src/widgets/table.rs | 1 + helix-vcs/Cargo.toml | 2 -- helix-vcs/src/diff.rs | 8 +++++++- helix-vcs/src/lib.rs | 12 +++++++++++- helix-vcs/src/status.rs | 22 ++++++++++------------ 17 files changed, 100 insertions(+), 21 deletions(-) diff --git a/helix-stdx/src/env.rs b/helix-stdx/src/env.rs index b3f46c25f..6f9a091e4 100644 --- a/helix-stdx/src/env.rs +++ b/helix-stdx/src/env.rs @@ -1,3 +1,4 @@ +//! Functions for working with the host environment. use std::{ borrow::Cow, ffi::{OsStr, OsString}, @@ -10,9 +11,9 @@ use once_cell::sync::Lazy; // We keep the CWD as a static so that we can access it in places where we don't have access to the Editor static CWD: RwLock> = RwLock::new(None); -// Get the current working directory. -// This information is managed internally as the call to std::env::current_dir -// might fail if the cwd has been deleted. +/// Get the current working directory. +/// This information is managed internally as the call to std::env::current_dir +/// might fail if the cwd has been deleted. pub fn current_working_dir() -> PathBuf { if let Some(path) = &*CWD.read().unwrap() { return path.clone(); @@ -37,6 +38,7 @@ pub fn current_working_dir() -> PathBuf { cwd } +/// Update the current working directory. pub fn set_current_working_dir(path: impl AsRef) -> std::io::Result> { let path = crate::path::canonicalize(path); std::env::set_current_dir(&path)?; @@ -45,14 +47,17 @@ pub fn set_current_working_dir(path: impl AsRef) -> std::io::Result