diff options
author | Triton171 | 2023-02-16 14:47:59 +0000 |
---|---|---|
committer | GitHub | 2023-02-16 14:47:59 +0000 |
commit | a1a6d5f3340ba8a587bbf8c178fe65589f36a51a (patch) | |
tree | d4dc784d6e4e02e2ee4f6578734869f4e92098c0 /helix-view/src | |
parent | d27e808fb3565d59b3082e4ce0bc8e381a03e16e (diff) |
Replace incorrect usages of tab_width with indent_width. (#5918)
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/document.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 11a0dbf8..bbcc8666 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -1122,13 +1122,18 @@ impl Document { self.syntax.as_ref() } - /// Tab size in columns. + /// The width that the tab character is rendered at pub fn tab_width(&self) -> usize { self.language_config() .and_then(|config| config.indent.as_ref()) .map_or(4, |config| config.tab_width) // fallback to 4 columns } + // The width (in spaces) of a level of indentation. + pub fn indent_width(&self) -> usize { + self.indent_style.indent_width(self.tab_width()) + } + pub fn changes(&self) -> &ChangeSet { &self.changes } |