File tree Expand file tree Collapse file tree 1 file changed +21
-14
lines changed Expand file tree Collapse file tree 1 file changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -23,22 +23,29 @@ export default function setupEventListener(
23
23
}
24
24
25
25
if ( activeEditor && event . document === activeEditor . document ) {
26
- diffLine = activeEditor . document . lineCount - fileLineCount ;
27
- fileLineCount = activeEditor . document . lineCount ;
26
+ /**
27
+ * redo and undo
28
+ */
29
+ if ( event . reason ) {
30
+ decorationManager . triggerUpdateDecorations ( true ) ;
31
+ } else {
32
+ diffLine = activeEditor . document . lineCount - fileLineCount ;
33
+ fileLineCount = activeEditor . document . lineCount ;
28
34
29
- const [ startLine , endLine , originalStartLine , originalEndLine ] =
30
- getStartEndLine ( event . document , event . contentChanges [ 0 ] ) ;
35
+ const [ startLine , endLine ] = getStartEndLine (
36
+ event . document ,
37
+ event . contentChanges [ 0 ]
38
+ ) ;
31
39
32
- decorationManager . setActiveEditor ( activeEditor ) ;
33
- decorationManager . triggerUpdateDecorations (
34
- event . reason ? false : diffLine === 0 ,
35
- true ,
36
- diffLine ,
37
- startLine ,
38
- endLine ,
39
- originalStartLine ,
40
- originalEndLine
41
- ) ;
40
+ decorationManager . setActiveEditor ( activeEditor ) ;
41
+ decorationManager . triggerUpdateDecorations (
42
+ diffLine === 0 ,
43
+ true ,
44
+ diffLine ,
45
+ startLine ,
46
+ endLine
47
+ ) ;
48
+ }
42
49
}
43
50
} ,
44
51
null ,
You can’t perform that action at this time.
0 commit comments