Vim Tips Wiki
(adjust Template:ScriptComments to remove id as no longer needed; minor tweaks)
(→‎Bugs: Remove the patch that is now included in the upstream.)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{ScriptComments|DrawIt: Ascii drawing plugin: lines, ellipses, arrows, fills, and more}}
 
{{ScriptComments|DrawIt: Ascii drawing plugin: lines, ellipses, arrows, fills, and more}}
  +
  +
==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:
  +
<pre>
  +
shift cursor up: \033[1;2A
  +
  +
shift cursor down: \033[1;2B
  +
  +
shift cursor left: \033[1;2D
  +
  +
shift cursor right: \033[1;2C
  +
</pre>
  +
  +
Note that \033 is generated by typing Esc
   
 
==Toolbar buttons==
 
==Toolbar buttons==
Line 42: Line 57:
   
 
==Comments==
 
==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:
  +
<pre>
  +
B | |
  +
/ A drawn to B ==> \ Instead of ==> /
  +
A | |
  +
</pre>
  +
[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 [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.