Skip to content

Commit

Permalink
Update number serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Dec 1, 2023
1 parent 5f1d178 commit 93d36d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<div>hello</div>
---

[#1.1 Content] =
[#1.1 Removal] = 0:0-0:5
[#.1 Content] =
[#.1 Removal] = 0:0-0:5
0| <div>hello</div>
>-----<

[#1.1 Insertion delimiter] = " "
[#.1 Insertion delimiter] = " "

[#1.2 Content] =
[#1.2 Removal] = 0:10-0:16
[#.2 Content] =
[#.2 Removal] = 0:10-0:16
0| <div>hello</div>
>------<

[#1.2 Insertion delimiter] = " "
[#.2 Insertion delimiter] = " "

[Domain] = 0:0-0:16
0| <div>hello</div>
Expand Down
9 changes: 6 additions & 3 deletions packages/cursorless-vscode-e2e/src/suite/serializeHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ export function serializeHeader({
}: SerializeHeaderArg): string {
const parts: string[] = [];
if (scopeNumber != null || targetNumber != null) {
const numberParts: string[] = ["#"];
if (scopeNumber != null) {
numberParts.push(scopeNumber.toString());
}
if (targetNumber != null) {
parts.push(`#${scopeNumber ?? 1}.${targetNumber}`);
} else {
parts.push(`#${scopeNumber}`);
numberParts.push(`.${targetNumber}`);
}
parts.push(numberParts.join(""));
}

if (prefix != null) {
Expand Down

0 comments on commit 93d36d0

Please sign in to comment.