Skip to content

Commit 9e4e546

Browse files
Charles Campbellvim-scripts
Charles Campbell
authored andcommitted
Version 10: Fixed a bug with text brushes and ctrl-leftmouse.
1 parent c9ec4f7 commit 9e4e546

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

autoload/DrawIt.vim

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
" DrawIt.vim: a simple way to draw things in Vim -- just put this file in
1+
" DrawIt.vim: a simple way to draw things in Vim
22
"
3-
" Maintainer: Charles E. Campbell, Jr. ([email protected])
4-
" Authors: Charles E. Campbell, Jr. ([email protected] - NOSPAM)
3+
" Maintainer: Charles E. Campbell, Jr.
4+
" Authors: Charles E. Campbell, Jr. <[email protected]> - NOSPAM
55
" Sylvain Viart ([email protected])
6-
" Version: 9
7-
" Date: Oct 10, 2007
6+
" Version: 10
7+
" Date: Jun 12, 2008
88
"
99
" Quick Setup: {{{1
1010
" tar -oxvf DrawIt.tar
@@ -49,7 +49,7 @@ set cpo&vim
4949
if !exists("s:saveposn_count")
5050
let s:saveposn_count= 0
5151
endif
52-
let g:loaded_DrawIt= "v9"
52+
let g:loaded_DrawIt= "v10"
5353
"DechoTabOn
5454

5555
" =====================================================================
@@ -1573,6 +1573,9 @@ fun! s:CLeftStart()
15731573
if s:cleft_height < 0
15741574
let s:cleft_height= -s:cleft_height
15751575
endif
1576+
if exists("s:cleft_oldblock")
1577+
unlet s:cleft_oldblock
1578+
endif
15761579
" call Decho("blocksize: ".s:cleft_height."x".s:cleft_width)
15771580
noremap <silent> <c-leftdrag> :<c-u>call <SID>CLeftDrag()<cr>
15781581
noremap <silent> <c-leftrelease> <leftmouse>:<c-u>call <SID>CLeftRelease()<cr>
@@ -1592,10 +1595,6 @@ fun! s:CLeftDrag()
15921595
" call Decho("draw prior contents<".s:cleft_oldblock.">")
15931596
exe 'let @'.b:drawit_brush.'=s:cleft_oldblock'
15941597
call s:PutBlock(b:drawit_brush,1)
1595-
else
1596-
" first move; put blanks where text had been
1597-
" call Decho("first move, put blanks where text was")
1598-
norm! gvr
15991598
endif
16001599

16011600
" move cursor to <leftmouse> position
@@ -1613,6 +1612,7 @@ fun! s:CLeftDrag()
16131612
exe "silent! norm! \<c-v>".s:cleft_height.'j"'.b:drawit_brush.'y'
16141613
endif
16151614
exe "let s:cleft_oldblock= @".b:drawit_brush
1615+
" call Decho("s:cleft_oldblock=@".b:drawit_brush)
16161616
" call Decho("cleft_height=".s:cleft_height." cleft_width=".s:cleft_width)
16171617
" call Decho("save contents<".s:cleft_oldblock.">")
16181618

doc/DrawIt.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*drawit.txt* The DrawIt Tool Sep 14, 2007
1+
*drawit.txt* The DrawIt Tool Jun 12, 2008
22

33
Authors: Charles E. Campbell, Jr. <[email protected]> {{{1
44
Sylvain Viart <[email protected]>
@@ -353,6 +353,8 @@ DRAWIT MODES *drawit-modes* {{{2
353353
==============================================================================
354354
4. History *drawit-history* {{{1
355355

356+
10 Jun 12, 2008 * Fixed a bug with ctrl-leftmouse (which was leaving
357+
a space in the original selected text)
356358
9 Sep 14, 2007 * Johann-Guenter Simon fixed a bug with s:DrawErase();
357359
it called SetDrawIt() and that call hadn't been
358360
updated to account for the new b:di_ellipse

plugin/DrawItPlugin.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
" You may also use visual-block mode to select endpoints and
66
" draw lines, arrows, and ellipses.
77
"
8-
" Date: Jul 18, 2006
9-
" Maintainer: Charles E. Campbell, Jr. ([email protected])
8+
" Date: May 20, 2008
9+
" Maintainer: Charles E. Campbell, Jr. <[email protected]>
1010
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
1111
" Permission is hereby granted to use and distribute this code,
1212
" with or without modifications, provided that this copyright
@@ -31,7 +31,7 @@
3131
if &cp || exists("g:loaded_DrawItPlugin")
3232
finish
3333
endif
34-
let g:loaded_DrawItPlugin = 1
34+
let g:loaded_DrawItPlugin = "v10"
3535
let s:keepcpo = &cpo
3636
set cpo&vim
3737

0 commit comments

Comments
 (0)