Mercurial > vim
annotate runtime/autoload/paste.vim @ 19738:0208534b8a84 v8.2.0425
patch 8.2.0425: code for modeless selection not sufficiently tested
Commit: https://github.com/vim/vim/commit/515545e11f523d14343b1e588dc0b9bd3d362bc2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 22 14:08:59 2020 +0100
patch 8.2.0425: code for modeless selection not sufficiently tested
Problem: Code for modeless selection not sufficiently tested.
Solution: Add tests. Move mouse code functionality to a common script file.
(Yegappan Lakshmanan, closes #5821)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 22 Mar 2020 14:15:04 +0100 |
parents | fe57e4f0eac1 |
children | 4027cefc2aab |
rev | line source |
---|---|
718 | 1 " Vim support file to help with paste mappings and menus |
2 " Maintainer: Bram Moolenaar <Bram@vim.org> | |
15729 | 3 " Last Change: 2019 Jan 27 |
718 | 4 |
5 " Define the string to use for items that are present both in Edit, Popup and | |
6 " Toolbar menu. Also used in mswin.vim and macmap.vim. | |
7 | |
15729 | 8 let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"} |
9 let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n'] | |
10 let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP" | |
718 | 11 |
15729 | 12 func! paste#Paste() |
13 let ove = &ve | |
14 set ve=all | |
15 normal! `^ | |
16 if @+ != '' | |
17 normal! "+gP | |
18 endif | |
19 let c = col(".") | |
20 normal! i | |
21 if col(".") < c " compensate for i<ESC> moving the cursor left | |
22 normal! l | |
23 endif | |
24 let &ve = ove | |
25 endfunc |