Skip to content

Commit d13caf6

Browse files
author
Reed Esau
committed
Truncating message line to avoid enter key
1 parent 7db7399 commit d13caf6

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

README.markdown

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ the usage is sound, you can elect to keep it —_wordy_ be damned.
3333

3434
Off-the-shelf proofreading software can scan your text for potential problems
3535
and provide comprehensive feedback. However, it may require a complex
36-
software installation or transmission of your work to a remote server for
37-
checking.
36+
software installation or transmission of your work to a remote server for
37+
checking.
3838

3939
_wordy_ stands ready as a simple alternative to these comprehensive tools,
40-
focusing narrowly on identifying potential problems that might otherwise
40+
focusing narrowly on identifying potential problems that might otherwise
4141
be missed. To compensate for _wordy_’s bare-bones approach, it’s best used
4242
in concert with the [literature on usage][lit] (Strunk and White, e.g.)
43-
and websites like the [English Language & Usage Stack Exchange][ese].
43+
and websites like the [English Language & Usage Stack Exchange][ese].
4444

4545
[lit]: http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=English+Usage
4646
[ese]: http://english.stackexchange.com
@@ -58,7 +58,7 @@ package manager.
5858

5959
### On demand
6060

61-
Using this plugin's commands does not require any special configuration.
61+
Using this plugins commands does not require any special configuration.
6262

6363
Important note: on the first use of each of the plugin’s dictionaries,
6464
a spell file will be built. This produces a message that resembles:
@@ -205,14 +205,14 @@ Instead of puffery, demonstrate through details.
205205
```
206206

207207
Words can be used to hide or obscure a weak position, or to cast doubt on
208-
a strong one. They can be used to mislead, to evade blame, or to claim credit
208+
a strong one. They can be used to mislead, to evade blame, or to claim credit
209209
where none has been earned.
210210

211211
* “mistakes were made”
212212
* “discounted up to 50% off”
213213
* “most voters feel that my opponent can’t be trusted”
214214

215-
Assuming that you’re not intentionally trying to manipulate others, you
215+
Assuming that you’re not intentionally trying to manipulate others, you
216216
will seek to purge such loaded language from your writing.
217217

218218
### To be and the passive voice
@@ -269,7 +269,7 @@ If you find this plugin useful, you may want to check out these others by
269269
* [vim-colors-pencil][cp] - color scheme for Vim inspired by IA Writer
270270
* [vim-lexical][lx] - building on Vim’s spell-check and thesaurus/dictionary completion
271271
* [vim-litecorrect][lc] - lightweight auto-correction for Vim
272-
* [vim-one][vo] - make use of Vim’s _+clientserver_ capabilities
272+
* [vim-one][vo] - make use of Vim’s _+clientserver_ capabilities
273273
* [vim-pencil][pn] - rethinking Vim as a tool for writers
274274
* [vim-textobj-quote][qu] - extends Vim to support typographic (‘curly’) quotes
275275
* [vim-textobj-sentence][ts] - improving on Vim's native sentence motion command

autoload/wordy.vim

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,24 @@ function! wordy#init(...) abort
5353
let l:msg = 'Unable to read source: ' . l:src_path
5454
endif
5555
endfor
56+
57+
let l:prefix = 'wordy: '
5658
if len(l:dst_paths) > 0
5759
let b:original_spl = &spelllang
5860
exe 'setlocal spelllang=' . l:lang . ',' . join(l:dst_paths, ',')
5961
setlocal spell
60-
let l:msg = join(l:dicts, ', ')
62+
63+
" the magic numbers derived empirically with MacVim
64+
" docs for rulerformat say 'The default ruler width is 17 characters'
65+
let l:msg = l:prefix . join(l:dicts, ', ')
66+
let l:max_len = &columns - strlen(l:prefix) - 5 - (&ruler ? 18 : 0)
67+
if strlen(l:msg) > l:max_len
68+
let l:msg = strpart(l:msg, 0, l:max_len-3) . '...'
69+
endif
6170
else
62-
let l:msg = 'off'
71+
let l:msg = l:prefix . 'off'
6372
endif
64-
echohl ModeMsg | echo 'wordy: ' . l:msg | echohl NONE
73+
echohl ModeMsg | echo l:msg | echohl NONE
6574
endfunction
6675

6776
function! wordy#jump(mode)

0 commit comments

Comments
 (0)