Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion indent/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ unlet s:cpo_save
function! Fixedgq(lnum, count)
let l:count = a:count

if mode() == 'i' " gq was not pressed, but tw was set
return 1
endif

if len(getline(a:lnum)) < 80 && l:count == 1 " No need for gq
return 1
endif
Expand All @@ -468,7 +472,7 @@ function! Fixedgq(lnum, count)
endif

" Try breaking after string
if breakpoint[1] == indent(a:lnum)
if breakpoint[1] <= indent(a:lnum)
call cursor(a:lnum, 81)
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
endif
Expand Down