Skip to content

Commit

Permalink
Fixed logic for finding token for renames.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Nov 12, 2023
1 parent 999ebe6 commit 4cdb93a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This version includes many other changes made prior to this log was created.
- Corrected English list literal tutorial, which didn't explain wraparound behavior of indices.
- Decoded getWebpage response as JSON-encoded string, fixing HTML parsing and querying.
- Keep editor caret displayed after losing focus to preserve menu location.
- Fixed caret position of multilingual name renames.

## 0.9.0

Expand Down
4 changes: 3 additions & 1 deletion src/edit/Caret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,9 @@ export default class Caret {
// Bail if we couldn't find it for some reason.
if (editedRevision === undefined) return undefined;
const start = revisedSource.getTokenTextPosition(
editedRevision[1].getFirstLeaf() as Token
editedRevision[1]
.leaves()
.find((t) => t.isSymbol(Sym.Name)) as Token
);
// Bail if we couldn't find the start position for some reason.
if (start === undefined) return undefined;
Expand Down

0 comments on commit 4cdb93a

Please sign in to comment.