Vim Tips Wiki
(→‎Bugs: Reply on fixed bug and how to report.)
(→‎Bugs: Remove the patch that is now included in the upstream.)
 
Line 67: Line 67:
 
A | |
 
A | |
 
</pre>
 
</pre>
  +
[SOLUTION] Upgrade to v13c from http://www.drchip.org/astronaut/vim/#DRAWIT
[SOLUTION] In DrawIt.vim (line ~2591), s:DrawLine, under the 'else' statement of 'if dx > dy', the statement 'if stepy > 0 || stepx < 0' should be changed to 'if stepx > 0'.
 
 
[EDIT] Confirmed the fix. To be clear, the following diff is needed:
 
<pre>
 
--- DrawIt.vim 2013-09-12 11:27:37.000000000 +0200
 
+++ DrawIt.vim.n 2013-09-12 11:27:33.000000000 +0200
 
@@ -2673,7 +2673,7 @@
 
while y0 != y1
 
let char = (g:drawit_mode == 'N')? b:di_vert : ((g:drawit_mode == 'S')? b:di_Svert : b:di_Dvert)
 
if fraction >= 0
 
- if stepy > 0 || stepx < 0
 
+ if stepy > 0 || stepx > 0
 
let char = (g:drawit_mode == 'N')? b:di_upleft : b:di_Supleft
 
else
 
let char = (g:drawit_mode == 'N')? b:di_upright : b:di_Supright
 
</pre>
 
   
 
:The way to submit bugs to Dr. Chip is old-fashioned, but robust: Send an email to the address listed in the plugin's header. The alpha version 13a / 18-Mar-2013 from [http://www.drchip.org/astronaut/vim/#DRAWIT his website] has this issue already fixed. -- [[User:Inkarkat|Inkarkat]] ([[User talk:Inkarkat|talk]]) 08:10, September 13, 2013 (UTC)
 
:The way to submit bugs to Dr. Chip is old-fashioned, but robust: Send an email to the address listed in the plugin's header. The alpha version 13a / 18-Mar-2013 from [http://www.drchip.org/astronaut/vim/#DRAWIT his website] has this issue already fixed. -- [[User:Inkarkat|Inkarkat]] ([[User talk:Inkarkat|talk]]) 08:10, September 13, 2013 (UTC)
  +
  +
: Actually this issue is fixed in 13c / 13-Sept-2013, but from the same place.

Latest revision as of 17:06, 13 September 2013

Use this page to discuss script 40 DrawIt: Ascii drawing plugin: lines, ellipses, arrows, fills, and more

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Shift + arrow key support in Mac OS X's Terminal[]

To have the shift + arrow key input (to move the cursor without drawing lines) work correctly in Terminal.app in OS X, it's necessary to add the following to Terminal's Preferences -> Settings -> Keyboard section:

shift cursor up:     \033[1;2A

shift cursor down:   \033[1;2B

shift cursor left:   \033[1;2D

shift cursor right:  \033[1;2C

Note that \033 is generated by typing Esc

Toolbar buttons[]

I've just been playing around with ToolBar button(s) and custom right mouse click menus for DrawIt. Maybe of interest to someone else:

amenu ]VlsDrawIt.Toggle\ Erase\ Mode<tab><space>   <space>
amenu ]VlsDrawIt.Make\ Blank\ Zone<tab>\\c         <Leader>c
amenu ]VlsDrawIt.Draw\ Flood<tab>\\e               <Leader>f

amenu ]VlsDrawItV.Draw\ Arrow<tab>\\a              gv<Leader>a
amenu ]VlsDrawItV.Draw\ Box<tab>\\b                gv<Leader>b
amenu ]VlsDrawItV.Draw\ Ellipse<tab>\\e            gv<Leader>e
amenu ]VlsDrawItV.Draw\ Line<tab>\\l               gv<Leader>l
amenu ]VlsDrawItV.Append\ Blanks<tab>\\s           gv<Leader>s

fun! s:StartDrawIt()
  aun ToolBar.DrawIt
  an <silent>icon=DrawItOff 1.16 ToolBar.DrawIt :call <SID>StopDrawIt()<CR>
  tm ToolBar.DrawIt               Stop drawing with DrawIt	\ds
  set lz
  call DrawIt#StartDrawIt()
  set nolz
  vunmap <buffer> <rightmouse>
  vnoremap <silent><buffer> <rightmouse> :<C-U>popup! ]VlsDrawItV<cr>gv
  nnoremap <silent><buffer> <rightmouse> :<C-U>popup! ]VlsDrawIt<cr>
endfun

fun! s:StopDrawIt()
  aun ToolBar.DrawIt
  an <silent> 1.16 ToolBar.DrawIt :call <SID>StartDrawIt()<CR>
  tm ToolBar.DrawIt               Start drawing with DrawIt	\di
  set lz
  call DrawIt#StopDrawIt()
  set nolz
  vunmap <buffer> <rightmouse>
  nunmap <buffer> <rightmouse>
endfun
an 1.16 ToolBar.DrawIt :call <SID>StartDrawIt()<CR>
tm ToolBar.DrawIt      Start drawing with DrawIt	\di

Comments[]

Bugs[]

This is the only forum I've found for Bug reports, so:

I experienced an arrow drawing bug during which arrows with a dx < dy and drawn in the lower left to upper right manner (or vice-versa) would display '\'s instead of '/'s. Eg:

 B                     |                   |
/   A drawn to B ==>  \   Instead of ==>  /
A                     |                   |

[SOLUTION] Upgrade to v13c from http://www.drchip.org/astronaut/vim/#DRAWIT

The way to submit bugs to Dr. Chip is old-fashioned, but robust: Send an email to the address listed in the plugin's header. The alpha version 13a / 18-Mar-2013 from his website has this issue already fixed. -- Inkarkat (talk) 08:10, September 13, 2013 (UTC)
Actually this issue is fixed in 13c / 13-Sept-2013, but from the same place.