Skip to content

Commit 75d9087

Browse files
committed
Disable custom gq for comments
1 parent 2e9424d commit 75d9087

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

indent/javascript.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,17 @@ function! Fixedgq(lnum, count)
443443
let l:tw = &tw ? &tw : 80;
444444

445445
let l:count = a:count
446+
let l:first_char = indent(a:lnum) + 1
446447

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

452+
" This gq is only meant to do code with strings, not comments
453+
if s:IsLineComment(a:lnum, l:first_char) || s:IsInMultilineComment(a:lnum, l:first_char)
454+
return 1
455+
endif
456+
451457
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
452458
return 1
453459
endif

0 commit comments

Comments
 (0)