Skip to content

Commit

Permalink
fix some bad state with gutter icon
Browse files Browse the repository at this point in the history
  • Loading branch information
furudean committed Oct 6, 2024
1 parent f2959b1 commit 715f5fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## Unreleased

- Fixes some bad state with gutter icon

## 1.22.1 - 2024-10-05

- Tweak gutter appearance
Expand Down
8 changes: 6 additions & 2 deletions src/lib/decoration.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as vscode from 'vscode'
import { AnyProcess } from './process'
import path from 'upath'

let current_decoration: vscode.TextEditorDecorationType | undefined
let current_line: number | undefined
Expand Down Expand Up @@ -32,8 +33,8 @@ function set_decorations(
if (
current_line &&
current_path &&
editor &&
editor.document.uri.fsPath.endsWith(current_path)
editor?.document.uri.fsPath ===
path.join(process.project_root, 'game', current_path)
) {
current_decoration = vscode.window.createTextEditorDecorationType({
gutterIconPath: context.asAbsolutePath('dist/arrow-right.svg'),
Expand All @@ -53,6 +54,9 @@ function set_decorations(
])
context.subscriptions.push(current_decoration)
process.on('exit', () => {
current_line = undefined
current_path = undefined
current_subscription?.dispose()
current_decoration?.dispose()
})
}
Expand Down

0 comments on commit 715f5fe

Please sign in to comment.