Skip to content

Commit

Permalink
Ignore directory (#8)
Browse files Browse the repository at this point in the history
* Ignore cspell when buffer is directory.

* Increment the version

* update project words

* Revert changes to pass tests

---------

Co-authored-by: ryicoh <ryicoh@gmail.com>
  • Loading branch information
ryu-ichiroh and ryicoh authored Jul 12, 2023
1 parent 1aa1cb0 commit c252c4d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .cspell/project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ matchadd
matchstr
norl
enddef
isdirectory
filereadable

# Name of variable
funcs
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ For [vim-plug](https://github.com/junegunn/vim-plug)

```vim
Plug 'ryuichiroh/vim-cspell', {'tag': 'v0.4'}
Plug 'ryuichiroh/vim-cspell', {'tag': 'v0.5'}
```

# Acknowledgements

* [async.vim](https://github.com/prabirshrestha/async.vim) is embedded with vim-cspell for manage Vim/Neovim jobs. Thanks!

6 changes: 6 additions & 0 deletions autoload/cspell.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ let s:latest_lint_job = 0
let s:use_vim9script = has('vim9script') && !exists('g:cspell_disable_vim9script')

function! cspell#lint() abort
let file = expand('%')
if isdirectory(file) || !filereadable(file)
return
endif

let cmd = s:get_command() . ' 2>&1'

let s:bad_words_by_buf[bufnr()] = []

let s:latest_lint_job = s:job_start(cmd, function('s:lint_callback'))
endfunction

Expand Down

0 comments on commit c252c4d

Please sign in to comment.