Skip to content

Commit 82a2173

Browse files
axrtianding1
authored andcommitted
Minor fix for the first-time leetcode list loading;
1 parent 6056f15 commit 82a2173

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

autoload/leetcode.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
" vim: sts=4 sw=4 expandtab
2-
2+
if exists("g:leetcode_list_buffer_exists")
3+
echo 'buffer exists'
4+
finish
5+
endif
36
let s:current_dir = expand("<sfile>:p:h")
47

58
python3 <<EOF
@@ -361,11 +364,10 @@ function! s:ListProblemsOfCompany(company_slug, refresh) abort
361364
endfunction
362365

363366
function! leetcode#ListProblems(refresh) abort
367+
let buf_name = 'leetcode:///problems/all'
364368
if s:CheckSignIn() == v:false
365369
return
366370
endif
367-
368-
let buf_name = 'leetcode:///problems/all'
369371
if buflisted(buf_name)
370372
execute bufnr(buf_name) . 'buffer'
371373
let saved_view = winsaveview()
@@ -378,6 +380,7 @@ function! leetcode#ListProblems(refresh) abort
378380
setlocal modifiable
379381
silent! normal! ggdG
380382
else
383+
let g:leetcode_list_buffer_exists=1
381384
execute 'rightbelow new ' . buf_name
382385
call s:SetupProblemListBuffer()
383386
let b:leetcode_buffer_type = 'all'

0 commit comments

Comments
 (0)