Skip to content

Commit ebdc0f3

Browse files
committed
Fixing very old bug with g:clang_close_preview set to 1 and pressing key (like semicolon) to close selection ...
When g:clang_close_preview is set to 1 then preview window should close whenever completion is selected. This worked when enter key was pressed or <c-y>, but when user just wanted to continue the code for example they pressed a semicolon, then preview window did not close, just the selection menu. After this it will close even in this scenario (if g:clang_close_preview is set to 1). Intentionallly in this case the first replacable is not selected (TriggerSnippet() is not called), this is as it was before in this scenario, so user can continue the writing of the code as they started. (They already started typing the code after completion and exited from completion selection menu by doing so.)
1 parent caeade8 commit ebdc0f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugin/clang_complete.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,10 @@ function! s:StopMonitoring()
551551
return
552552
endif
553553

554+
if g:clang_close_preview == 1
555+
pclose
556+
endif
557+
554558
if g:clang_make_default_keymappings == 1
555559
" Restore original return and Ctrl-Y key mappings
556560

@@ -593,10 +597,6 @@ function! s:TriggerSnippet()
593597

594598
" Trigger the snippet
595599
execute s:py_cmd 'snippetsTrigger()'
596-
597-
if g:clang_close_preview == 1
598-
pclose
599-
endif
600600
endfunction
601601

602602
function! s:ShouldComplete()

0 commit comments

Comments
 (0)