File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -1069,6 +1069,7 @@ function! s:ShowRunResultInPreview(result) abort
10691069 hi ! link lcWarning lcFailure
10701070
10711071 execute saved_winnr . ' wincmd w'
1072+ call <SID> UpdateSubmitState (a: result )
10721073endfunction
10731074
10741075function ! s: CheckRunCodeTask (timer) abort
@@ -1295,3 +1296,29 @@ function! s:FormatIntoColumns(words) abort
12951296
12961297 return lines
12971298endfunction
1299+
1300+ function ! s: UpdateSubmitState (result)
1301+ let state = ' ?'
1302+ if a: result [' state' ] == ' Accepted'
1303+ let state = ' X'
1304+ endif
1305+ let buffers = filter (range (1 , bufnr (' $' )), ' buflisted(v:val)' )
1306+ for b in buffers
1307+ let name = bufname (b )
1308+ if name !~ ' leetcode:\/\/\/problems'
1309+ continue
1310+ endif
1311+
1312+ let problems = getbufvar (b , ' leetcode_downloaded_problems' )
1313+ if type (problems) != 3
1314+ continue
1315+ endif
1316+
1317+ for problem in problems
1318+ if problem[' title' ] == a: result [' title' ]
1319+ let problem[' state' ] = state
1320+ break
1321+ endif
1322+ endfor
1323+ endfor
1324+ endfunction
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ if !exists('g:leetcode_debug')
2424 let g: leetcode_debug = 0
2525endif
2626
27- command ! -nargs =0 LeetCodeList call leetcode#ListProblems (' norefresh ' )
27+ command ! -nargs =0 LeetCodeList call leetcode#ListProblems (' redraw ' )
2828command ! -nargs =0 LeetCodeReset call leetcode#ResetSolution (0 )
2929command ! -nargs =0 LeetCodeTest call leetcode#TestSolution ()
3030command ! -nargs =0 LeetCodeSubmit call leetcode#SubmitSolution ()
You can’t perform that action at this time.
0 commit comments