Skip to content

Commit

Permalink
fix: support any IDE for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric Halbronn committed Mar 25, 2024
1 parent 4f9aa5d commit 2eebc05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/cursorless-neovim/src/neovimHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ide } from "@cursorless/cursorless-engine";
// import { receivedBufferEvent } from "./types/BufferManager";
import { NeovimTextEditorImpl } from "./ide/neovim/NeovimTextEditorImpl";
import { NeovimIDE } from "./ide/neovim/NeovimIDE";
import { SpyIDE } from "@cursorless/common";
import { NormalizedIDE, SpyIDE } from "@cursorless/common";

/**
* Initialize the current editor (and current document).
Expand All @@ -35,9 +35,12 @@ export async function updateTextEditor(): Promise<NeovimTextEditorImpl> {
);
const visibleRanges = await windowGetVisibleRanges(window, client, lines);
const ide_ = ide();
// TODO: It there a clean way to do it?
let neovimIDE: NeovimIDE;
if (ide_ instanceof NeovimIDE) {
neovimIDE = ide_;
} else if (ide_ instanceof NormalizedIDE) {
neovimIDE = ide_.original as NeovimIDE;
} else if (ide_ instanceof SpyIDE) {
neovimIDE = ide_.original as NeovimIDE;
} else {
Expand Down

0 comments on commit 2eebc05

Please sign in to comment.