Skip to content

Commit

Permalink
Merge branch 'fix-visual-empty'
Browse files Browse the repository at this point in the history
  • Loading branch information
haya14busa committed Nov 27, 2014
2 parents 9227b36 + 774ab6d commit 1a349c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/asterisk.vim
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ function! asterisk#do(mode, config) abort
let pattern = (s:is_visual(a:mode) ?
\ s:convert_2_word_pattern(s:get_selected_text(), config) : s:cword_pattern(config))
if s:is_empty_cword(pattern) " 'E348: No string under cursor'
return '*'
if s:is_visual(a:mode)
return "\<Esc>:echohl ErrorMsg | echom 'asterisk.vim: No selected string' | echohl None\<CR>"
else
return '*'
endif
endif
let should_plus_one_count = s:should_plus_one_count(pattern, config, a:mode)
let maybe_count = (should_plus_one_count ? string(v:count1 + 1) : '')
Expand Down

0 comments on commit 1a349c9

Please sign in to comment.