fix emoji support in autofmt
This commit is contained in:
1 parent
fd4eac3488
commit
cc8b910cf3
4 files changed
+48
-36
No files matched your search
@@ -1,14 +1,17 @@
|
||||
pub fn find_bracket_end(contents: &str) -> Option<usize> {
|
||||
let mut depth = 0;
|
||||
|
||||
for (i, c) in contents.chars().enumerate() {
|
||||
let mut len = 0;
|
||||
|
||||
for c in contents.chars() {
|
||||
len += c.len_utf8();
|
||||
if c == '{' {
|
||||
depth += 1;
|
||||
} else if c == '}' {
|
||||
depth -= 1;
|
||||
|
||||
if depth == 0 {
|
||||
return Some(i);
|
||||
return Some(len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user