diff options
author | Skyler Hawthorne | 2022-03-17 03:34:21 +0000 |
---|---|---|
committer | Skyler Hawthorne | 2022-06-19 03:54:03 +0000 |
commit | 0f3c10a021bbe79e20bde1f55b87465edeec476d (patch) | |
tree | a2d54e96885b5761e806eddd9bd8206071d15e8c /helix-loader/src/lib.rs | |
parent | 502d3290fb88d8a871b0824adc7987a98104933d (diff) |
Fix initial selection of Document in new view
When a new View of a Document is created, a default cursor of 0, 0 is
created, and it does not get normalized to a single width cursor until
at least one movement of the cursor happens. This appears to have no
practical negative effect that I could find, but it makes tests difficult
to work with, since the initial selection is not what you expect it to be.
This changes the initial selection of a new View to be the width of the
first grapheme in the text.
Diffstat (limited to 'helix-loader/src/lib.rs')
-rw-r--r-- | helix-loader/src/lib.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index 595ac7aa..ff4414b2 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -13,7 +13,9 @@ pub fn runtime_dir() -> std::path::PathBuf { if let Ok(dir) = std::env::var("CARGO_MANIFEST_DIR") { // this is the directory of the crate being run by cargo, we need the workspace path so we take the parent - return std::path::PathBuf::from(dir).parent().unwrap().join(RT_DIR); + let path = std::path::PathBuf::from(dir).parent().unwrap().join(RT_DIR); + log::debug!("runtime dir: {}", path.to_string_lossy()); + return path; } const RT_DIR: &str = "runtime"; |