summaryrefslogtreecommitdiff
path: root/cli/lsp/tsc.rs
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2021-04-06 13:27:27 +1000
committerGitHub <noreply@github.com>2021-04-06 13:27:27 +1000
commit2c52c0a145337050fee03313a7c5698b761969dc (patch)
tree0223a329fc52ec95ad7732d2747dd7c1f8874d04 /cli/lsp/tsc.rs
parent91e80ada8a323a6526f760d41f2ebc481814e843 (diff)
fix(lsp): folding range adjustment panic (#10030)
Fixes #10029
Diffstat (limited to 'cli/lsp/tsc.rs')
-rw-r--r--cli/lsp/tsc.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs
index 1a3866990..38b736349 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -1288,7 +1288,7 @@ impl OutliningSpan {
content: &[u8],
line_folding_only: bool,
) -> u32 {
- if line_folding_only && range.end.character > 0 {
+ if line_folding_only && range.end.line > 0 && range.end.character > 0 {
let offset_end: usize = line_index.offset(range.end).unwrap().into();
let fold_end_char = content[offset_end - 1];
if FOLD_END_PAIR_CHARACTERS.contains(&fold_end_char) {