Skip to content

Commit 705ccbb

Browse files
committed
Don't add close brace after @Override without method declaration
1 parent d81b358 commit 705ccbb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

autoload/javacomplete.vim

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,21 @@ function! s:HandleTextChangedI()
277277
endif
278278

279279
if get(g:, 'JC_DeclarationCompletedFlag', 0)
280-
if getline('.')[col('.') - 2] != ' '
280+
let line = getline('.')
281+
if line[col('.') - 2] != ' '
281282
return
282283
endif
283284

284285
let g:JC_DeclarationCompletedFlag = 0
286+
287+
if line !~ '.*@Override.*'
288+
let line = getline(line('.') - 1)
289+
endif
290+
291+
if line =~ '.*@Override\s\+\(\S\+\|\)\(\s\+\|\)$'
292+
return
293+
endif
294+
285295
if !empty(javacomplete#util#Trim(getline('.')))
286296
call feedkeys("\b\r", "n")
287297
endif

0 commit comments

Comments
 (0)