mirror of
https://github.com/preservim/vim-wordy.git
synced 2025-11-10 02:43:48 -05:00
Truncating message line to avoid enter key
This commit is contained in:
@@ -58,7 +58,7 @@ package manager.
|
||||
|
||||
### On demand
|
||||
|
||||
Using this plugin's commands does not require any special configuration.
|
||||
Using this plugin’s commands does not require any special configuration.
|
||||
|
||||
Important note: on the first use of each of the plugin’s dictionaries,
|
||||
a spell file will be built. This produces a message that resembles:
|
||||
|
||||
@@ -53,15 +53,24 @@ function! wordy#init(...) abort
|
||||
let l:msg = 'Unable to read source: ' . l:src_path
|
||||
endif
|
||||
endfor
|
||||
|
||||
let l:prefix = 'wordy: '
|
||||
if len(l:dst_paths) > 0
|
||||
let b:original_spl = &spelllang
|
||||
exe 'setlocal spelllang=' . l:lang . ',' . join(l:dst_paths, ',')
|
||||
setlocal spell
|
||||
let l:msg = join(l:dicts, ', ')
|
||||
else
|
||||
let l:msg = 'off'
|
||||
|
||||
" the magic numbers derived empirically with MacVim
|
||||
" docs for rulerformat say 'The default ruler width is 17 characters'
|
||||
let l:msg = l:prefix . join(l:dicts, ', ')
|
||||
let l:max_len = &columns - strlen(l:prefix) - 5 - (&ruler ? 18 : 0)
|
||||
if strlen(l:msg) > l:max_len
|
||||
let l:msg = strpart(l:msg, 0, l:max_len-3) . '...'
|
||||
endif
|
||||
echohl ModeMsg | echo 'wordy: ' . l:msg | echohl NONE
|
||||
else
|
||||
let l:msg = l:prefix . 'off'
|
||||
endif
|
||||
echohl ModeMsg | echo l:msg | echohl NONE
|
||||
endfunction
|
||||
|
||||
function! wordy#jump(mode)
|
||||
|
||||
Reference in New Issue
Block a user