Add support for hard tabs
* Add a `hard_tabs` setting that causes indentation to be performed using a tab instead of multiple spaces. * Change Buffer's indentation-related APIs to return an `IndentSize` struct with a length and a kind, instead of just a single u32. * Use hard tabs by default in Go.
This commit is contained in:
parent
129fc515ef
commit
f62fd3cddd
8 changed files with 324 additions and 200 deletions
|
@ -1642,18 +1642,6 @@ impl BufferSnapshot {
|
|||
.all(|chunk| chunk.matches(|c: char| !c.is_whitespace()).next().is_none())
|
||||
}
|
||||
|
||||
pub fn indent_column_for_line(&self, row: u32) -> u32 {
|
||||
let mut result = 0;
|
||||
for c in self.chars_at(Point::new(row, 0)) {
|
||||
if c == ' ' {
|
||||
result += 1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
pub fn text_summary_for_range<'a, D, O: ToOffset>(&'a self, range: Range<O>) -> D
|
||||
where
|
||||
D: TextDimension,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue