Skip to content

Commit

Permalink
fix: attempting to access cursorTooltipField when popup preview is …
Browse files Browse the repository at this point in the history
…disabled causes an error
  • Loading branch information
artisticat1 committed Jun 22, 2024
1 parent c32d2d1 commit 15b2bf5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/latex_suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ import { cursorTooltipBaseTheme, cursorTooltipField, handleMathTooltip } from ".
import { isComposing } from "./utils/editor_utils";

export const handleUpdate = (update: ViewUpdate) => {
const settings = getLatexSuiteConfig(update.state);

// The math tooltip handler is driven by view updates because it utilizes
// information about visual line, which is not available in EditorState
handleMathTooltip(update);
if (settings.mathPreviewEnabled) {
handleMathTooltip(update);
}

const cursorTriggeredByChange = update.state.field(cursorTriggerStateField, false);

Expand Down

0 comments on commit 15b2bf5

Please sign in to comment.