Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor(editor): clear history
  • Loading branch information
antonreshetov committed Aug 12, 2022
commit 38f2efec40da469997b5bec7bfdfd3b851765b5d
9 changes: 6 additions & 3 deletions src/renderer/components/editor/EditorCodemirror.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ const clearAllMarks = () => {
}
}

const clearHistory = () => {
if (!editor) return
editor.clearHistory()
}

const format = async () => {
const availableLang: Language[] = [
'css',
Expand Down Expand Up @@ -293,9 +298,7 @@ watch(
findAll(snippetStore.searchQuery)
}

if (editor) {
editor.clearHistory()
}
clearHistory()
}
)

Expand Down