Skip to content

Commit

Permalink
Compatibility: After Vim 8.1.1241, a :range outside the number of buf…
Browse files Browse the repository at this point in the history
…fers (e.g. :99Mark[Name]) causes an error

Need to supply -addr=other (except on very old Vim versions).
  • Loading branch information
inkarkat committed May 2, 2019
1 parent 694a804 commit 6016b28
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ https://github.com/inkarkat/vim-mark/issues or email (address below).
HISTORY
------------------------------------------------------------------------------

##### 3.1.1 RELEASEME
- Compatibility: After Vim 8.1.1241, a :range outside the number of buffers
(e.g. :99Mark[Name]) causes an error.

##### 3.1.0 23-Mar-2019
- ENH: Handle magicness atoms (\\V, \\m) in regexps entered via <Leader>r or
:Mark /{pattern}/.
Expand Down
4 changes: 4 additions & 0 deletions doc/mark.txt
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,10 @@ https://github.com/inkarkat/vim-mark/issues or email (address below).
==============================================================================
HISTORY *mark-history*

3.1.1 RELEASEME
- Compatibility: After Vim 8.1.1241, a :range outside the number of buffers
(e.g. :99Mark[Name]) causes an error.

3.1.0 23-Mar-2019
- ENH: Handle magicness atoms (\V, \m) in regexps entered via <Leader>r or
:Mark /{pattern}/.
Expand Down
16 changes: 14 additions & 2 deletions plugin/mark.vim
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,13 @@ endif

"- commands -------------------------------------------------------------------

command! -bang -range=0 -nargs=? -complete=customlist,mark#Complete Mark if <bang>0 | silent call mark#DoMark(<count>, '') | endif | if ! mark#SetMark(<count>, <f-args>)[0] | echoerr ingo#err#Get() | endif
let s:hasArgumentAddressing = (v:version == 704 && has('patch530') || v:version > 704)

if s:hasArgumentAddressing
command! -bang -range=0 -addr=other -nargs=? -complete=customlist,mark#Complete Mark if <bang>0 | silent call mark#DoMark(<count>, '') | endif | if ! mark#SetMark(<count>, <f-args>)[0] | echoerr ingo#err#Get() | endif
else
command! -bang -range=0 -nargs=? -complete=customlist,mark#Complete Mark if <bang>0 | silent call mark#DoMark(<count>, '') | endif | if ! mark#SetMark(<count>, <f-args>)[0] | echoerr ingo#err#Get() | endif
endif
command! -bar MarkClear call mark#ClearAll()
command! -bar Marks call mark#List()

Expand Down Expand Up @@ -185,7 +191,13 @@ function! s:MarkPaletteComplete( ArgLead, CmdLine, CursorPos )
return sort(filter(keys(g:mwPalettes), 'v:val =~ ''\V\^'' . escape(a:ArgLead, "\\")'))
endfunction
command! -bar -nargs=1 -complete=customlist,<SID>MarkPaletteComplete MarkPalette call <SID>SetPalette(<q-args>)
command! -bar -bang -range=0 -nargs=? MarkName if ! mark#SetName(<bang>0, <count>, <q-args>) | echoerr ingo#err#Get() | endif
if s:hasArgumentAddressing
command! -bar -bang -range=0 -addr=other -nargs=? MarkName if ! mark#SetName(<bang>0, <count>, <q-args>) | echoerr ingo#err#Get() | endif
else
command! -bar -bang -range=0 -nargs=? MarkName if ! mark#SetName(<bang>0, <count>, <q-args>) | echoerr ingo#err#Get() | endif
endif

unlet s:hasArgumentAddressing



Expand Down

0 comments on commit 6016b28

Please sign in to comment.