File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
src/renderer/components/editor Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,11 @@ const clearAllMarks = () => {
232232 }
233233}
234234
235+ const clearHistory = () => {
236+ if (! editor ) return
237+ editor .clearHistory ()
238+ }
239+
235240const format = async () => {
236241 const availableLang: Language [] = [
237242 ' css' ,
@@ -285,22 +290,15 @@ const hideScrollbar = useDebounceFn(() => {
285290}, 1000 )
286291
287292watch (
288- () => props .modelValue ,
293+ () => [ props .snippetId , props . fragmentIndex ] ,
289294 () => {
290295 setValue (props .modelValue )
291296
292297 if (snippetStore .searchQuery ) {
293298 findAll (snippetStore .searchQuery )
294299 }
295- }
296- )
297300
298- watch (
299- () => [props .snippetId , props .fragmentIndex ].concat (),
300- () => {
301- if (editor ) {
302- editor .clearHistory ()
303- }
301+ clearHistory ()
304302 }
305303)
306304
You can’t perform that action at this time.
0 commit comments