[WASTE-list] pasted tab widths

Marco Piovanelli marco.piovanelli at pobox.com
Fri Mar 7 05:51:49 EST 2008


On Mon, 3 Mar 2008 19:15:49 -0700,
Ryan Joseph (ryan at web-scripter.com) wrote:



>Can I prevent text pasted into WASTE from changing the tab widths? Or

>maybe a better broader question would be, what is the best way to

>implement a feature like "Paste and Match Style" in MLTE? I had to

>trap the HICommandPaste and wrap WEProcessHICommand with calls to

>WEGetOneAttribute/WESetOneAttribute and then it was very slow if I

>didn't disable redrawing for the setting of the old attributes. thanks.


The short answer is yes, but you need a recent (post-3.1b2) build,
one that I haven't had time to make public yet. I think I have
already sent you this private build.

Anyway, the best way to implement a feature like "Paste and Match Style"
with WASTE 3.0 is to have a UI element (probably a menu item) that
sends the kHICommandPasteAndMatchStyle (== 'P&MS') command, and let
WASTE handle the command.

If, for some reason, you cannot let WASTE install its own command
event handlers, you can manually paste unstyled text from a pasteboard
or scrap by specifying the wePastePlainText option in your call to one
of the following:

WEPasteFromPasteboard
WEPasteFromScrap
WECanPasteFromPasteboard
WECanPasteFromScrap

At the lowest level, WEPut() now has an option to ignore style
information, wePutPlainText. This is handy when you need to insert,
say, RTF data, but want to strip off all the formatting.


-- marco


--
It's not the data universe only, it's human conversation.
They want to turn it into a one-way flow that they have entirely
monetized. I look at the collective human mind as a kind of
ecosystem. They want to clear cut it. They want to go into the
rainforest of human thought and mow the thing down.



More information about the WASTE-list mailing list