aboutsummaryrefslogtreecommitdiff
path: root/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/mail.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/ftplugin/mail.vim b/ftplugin/mail.vim
new file mode 100644
index 0000000..af35487
--- /dev/null
+++ b/ftplugin/mail.vim
@@ -0,0 +1,11 @@
+function s:update_wrapping()
+ if coc#source#khard#should_complete({ 'line': getline('.') })
+ " temporarily disable line wrapping
+ setlocal formatoptions-=tc
+ else
+ " re-enable line wrapping
+ setlocal formatoptions+=tc
+ endif
+endfunction
+
+autocmd CursorMoved,CursorMovedI <buffer> call s:update_wrapping()