From a1a6d5f3340ba8a587bbf8c178fe65589f36a51a Mon Sep 17 00:00:00 2001 From: Triton171 Date: Thu, 16 Feb 2023 15:47:59 +0100 Subject: Replace incorrect usages of tab_width with indent_width. (#5918) --- helix-view/src/document.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'helix-view/src/document.rs') 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 } -- cgit v1.2.3-70-g09d2