2009/8/1 Jjgod Jiang <[email protected]>:
>
> Running vim under Mac OS X terminal do not support copy to/from
> system clipboard currently, this patch add this feature. To have
> this feature in mainstream, we receive the following benifits:
>
> 1. We can copy from/to system clipboard without running GUI.
>   (Default vim builds shipped with Mac OS X do not have GUI
>    enabled, so it can share this feature.)
> 2. We don't need to duplicate code in GUI implementations like
>   MacVim or vim-cocoa.
>
> The clipboard handling code is derived from MacVim.
>
> To use Cocoa APIs, we need to convert os_macosx.c into an Obj-C
> file. Other changes are trivial.

A few comments on this patch:

1. Why have you not included the code that handles block-wise copy in
clip_mch_request_selection() from the MacVim sources?  This is a bad
idea since it means that every time you copy from Vim the pasteboard
will only keep a "line-wise" copy.  E.g. if you enter visual block
mode, copy, then paste, the text will be pasted line-wise even though
it should be pasted block-wise.  Why did you "derive" the clipboard
code from MacVim instead of just copying it?

2. I'm not decided on this myself, but maybe it would be cleaner to
implement this using the Carbon Pasteboard Manager instead of using
Cocoa (so that you don't have to use the Objective-C compiler, fiddle
around with autorelease pools, link against Cocoa etc.):

http://developer.apple.com/documentation/Carbon/Reference/Pasteboard_Reference/Reference/reference.html


At any rate, I would not merge this patch until #1 is resolved.  The
second issue is more delicate but I have myself implemented copy/paste
using Pasteboard Manager once and I know that it is not that much of
an effort, but then again the current MacVim clipboard code works and
has been in use for quite some time so it is maybe a better idea to
just include it verbatim.

Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui