Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: haya14busa/vim-asterisk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7efb136b0f2a961bce06198954cecd2ac3bdfd39
Choose a base ref
..
head repository: haya14busa/vim-asterisk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bffa3106246067ea863dd355303e3450da1c8cc6
Choose a head ref
Showing with 36 additions and 9 deletions.
  1. +12 −0 .github/workflows/reviewdog.yml
  2. +1 −1 README.md
  3. +8 −1 autoload/asterisk.vim
  4. +2 −2 doc/asterisk.txt
  5. +1 −1 test/basic_asterisk.vimspec
  6. +1 −1 test/keeppos.vimspec
  7. +9 −1 test/visual.vimspec
  8. +2 −2 test/zstar.vimspec
12 changes: 12 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: reviewdog
on: [pull_request]
jobs:
vint:
name: runner / vint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: vint
uses: reviewdog/action-vint@v1
with:
github_token: ${{ secrets.github_token }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ let g:asterisk#keeppos = 1

Special thanks
--------------
|asterisk.vim| uses the code from vim-visualstar for visual star feature.
|vim-asterisk| uses the code from vim-visualstar for visual star feature.

- Author: thinca (https://github.com/thinca)
- Plugin: https://github.com/thinca/vim-visualstar
9 changes: 8 additions & 1 deletion autoload/asterisk.vim
Original file line number Diff line number Diff line change
@@ -84,7 +84,13 @@ function! asterisk#do(mode, config) abort
\ (a:mode isnot# 'n' ? "\<Esc>" : '')
\ . 'm`'
\ . (config.direction is s:DIRECTION.forward ? '0' : '$')
let aftermove = "\<C-o>"
" NOTE: Neovim doesn't stack pos to jumplist after "m`".
" https://github.com/haya14busa/vim-asterisk/issues/34
if has('nvim')
let aftermove = '``'
else
let aftermove = "\<C-o>"
endif
" NOTE: To avoid hit-enter prompt, it execute `restore` and `echo`
" command separately. I can also implement one function and call it
" once instead of separately, should I do this?
@@ -165,6 +171,7 @@ function! s:convert_2_word_pattern_4_visual(pattern, config) abort
endif
endif
let text = substitute(escape(text, '\' . type), "\n", '\\n', 'g')
let text = substitute(text, "\r", '\\r', 'g')
return '\V' . pre . text . post
endfunction

4 changes: 2 additions & 2 deletions doc/asterisk.txt
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ KEY MAPPINGS *asterisk-key-mappings*
<Plug>(asterisk-gz#) *<Plug>(asterisk-gz#)*

Basic behavior is almost same with default one.
See: |star|, |#|, |gsatr|, |g#|
See: |star|, |#|, |gstar|, |g#|

Improvement:
- It uses not only 'ignorecase' but also 'smartcase' unlike
@@ -125,7 +125,7 @@ g:asterisk#keeppos *g:asterisk#keeppos*
KNOWN ISSUES *asterisk-issues*

Issues
https://github.com/haya14busa/asterisk.vim/issues
https://github.com/haya14busa/vim-asterisk/issues


==============================================================================
2 changes: 1 addition & 1 deletion test/basic_asterisk.vimspec
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ Describe basic_asterisk
End

Before each
:1
call cursor([1, 1])
normal! 2l
End

2 changes: 1 addition & 1 deletion test/keeppos.vimspec
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ Describe basic_asterisk
End

Before each
:1
call cursor([1, 1])
normal! 2l
End

10 changes: 9 additions & 1 deletion test/visual.vimspec
Original file line number Diff line number Diff line change
@@ -11,12 +11,13 @@ Describe visual
\ , '.* asterisk asterisk'
\ , '".*" ".*" ''asterisk'' ''asterisk'''
\ , '"''.*" "''.*" "aste"risk" "aste"risk"'
\ , "asterisk\r"
\ ]
call g:Add_lines(lines)
End

Before each
:1
call cursor([1, 1])
normal! 2l
let @/ = ''
End
@@ -119,5 +120,12 @@ Describe visual
End
End

Context contains \r
It handles correctly
normal 8j$v*
Assert Equals(@/, '\V\r')
End
End


End
4 changes: 2 additions & 2 deletions test/zstar.vimspec
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ Describe zstar
End

Before each
:1
call cursor([1, 1])
normal! 2l
let @/ = ''
End
@@ -49,7 +49,7 @@ Describe zstar
call g:Add_lines(['NeoBundle "kannokanno/previm"'])
let save = &selection
for v in ['inclusive', 'old', 'exclusive']
:1
call cursor([1, 1])
Assert Equals(g:Get_pos_char(), 'N')
let &selection=v
normal ve6ho*