Problem Pasting Line Blocks

Get help with installation and running Multi-Edit here. Bug reports can be posted here but please not post feature requests here.

Moderator: Moderators

Postby laszlo on Fri Aug 10, 2007 9:29 pm

DanHughes wrote:the Windows clipboard only supports stream type blocks
It is not true: you can define your own clipboard format. An example is in Word, pressing the ALT button while the mouse selects text, marks a column block. Copy/pasting it into other part of the document will result in true block copy. That is, one of the several Windows clipboard formats used by Word knows about column blocks.
DanHughes wrote:Multi-Edit "hooks" into the Windows clipboard API so that it will be notified of changes to the Windows clipboard
This mechanism is known to be unreliable. Although this is a Windows problem, it looks safer for ME to use the Windows clipboard with ME specific formats.
DanHughes wrote:Sometimes other programs, especially clipboard extension programs, do things to the clipboard that makes the notification system to behave differently than it should and causes Multi-Edit to get confused.
I don't use any programs like this. Only Visual Studio 2005, Explorer, Lotus Notes and IE7 are running. VS'05 looks fishy, though, when it is open, the clipboard seems to be less reliable. But, it has been reported in forums (e.g. AutoHotkey), that the clipboard change notification of Windows sometimes does not work.
DanHughes wrote:we set a flag to ignore the next clipboard notification right after we do a copy to the Windows clipboard
This is risky, because the clipboard notification is asynchronous to ME, sometimes it comes a couple of seconds later, and during this time the user could attempt a copy already. It just confirms, that it would be safer to always use the Windows clipboard with a ME specific format.
DanHughes wrote:have two different keys that do a Paste and use one for when I want to use the internal clipboard and the other when I want to use the normal Windows clipboard
I also experimented with a similar workaround. I leave Ctrl-V to its default (which worked with ME clipboards OK so far), and define Alt-V for Paste Special, when I know I want to use the Windows clipboard by all means. It seems to work OK, especially, since I have defined Alt-V in Word for paste unformatted text, and the functionalities are similar. Nevertheless, these are just workarounds for a problem, waiting for a real solution.
laszlo
Registered User
 
Posts: 21
Joined: Mon Jul 25, 2005 9:49 pm
Location: Pittsburgh

Happy ending and speculation

Postby cwb3106 on Sun Aug 12, 2007 2:30 pm

As I posted earlier, I stumbled my way to a work-around and have been giving it time to break. And it hasn't! Yeah!

As Dan surmised, the problem is an interaction with my clipboard manager (CLCL). If I turn it off, I don't have the problem. But I've become dependent on it -- mainly for all those other applications that don't have multiple clipboard buffers like Multi Edit.

The workaround required three changes. First I changed the clipboard manager to use Shift+Insert to execute a paste, but only in Multi Edit (fortunately it allows application specific key mapping; unfortunately, the feature is undocumented). Then changed Multi Edit so that Shift+Insert maps to Paste Special (instead of Paste from buffer). Finally I turned off Standard copy uses the paste buffers. This fix disables the internal buffers but I'd rather have the clipboard manager than those. I'll hang on to Dan's suggestion in case I change my mind about the buffers.

Laszlo's suggestion seems like the best long-term fix … even if parts of his reasoning are suspect. Just because Word can copy/paste column blocks doesn't mean that column block is a valid clipboard format. After all, Multi Edit can copy/paste column blocks and ... we'll that's why we're here. But still, a great idea! A quick web search turned up this MSDN article: Clipboard Formats (http://msdn2.microsoft.com/en-us/library/ms649013.aspx). Among other things, the article states: Many applications work with data that cannot be translated into a standard clipboard format without loss of information. These applications can create their own clipboard formats.

If that doesn't work, (begin crazy ideas) would a reverse time out help? That is, if a second notification is received soon (e.g., < 10 ms) after the first, ignore it? Or perhaps compare the windows clipboard to the active buffer and ignore the notification if they have the same text content? (end crazy ideas)

Anyway, thanks for the help. Not many companies give this much help to users running old versions of their products (or, sadly, even the current version).
cwb3106
Registered User
 
Posts: 10
Joined: Sun Aug 03, 2003 3:48 pm
Location: Fairfax VA

Postby DanHughes on Thu Aug 16, 2007 3:54 pm

All of the clipboard handling code was written many years ago and probably was written as they were because the Windows clipboard did not provide the features it does today. In fact most of the Multi-Edit clipboard routines were written to work under Dos and were just modified to use the Windows clipboard when it was made to work under Windows. I was not aware of the clipboard "custom" formats, but then I have not done much with this code in years either, too many other thing to keep me busy ;)

When I get some time, I'll investigate this feature of the Windows clipboard to see if it would be suitable for our use. I really don't want to loose the ability to maintain multiple buffers so it might not fit our needs but in any case I want to see if we can come up with a more reliable solution to using the Windows clipboard with Multi-Edit.

Thanks everyone for your feedback. It is much appreciated. I wish I had more time to learn all of these kinds of things but with the great user base we have, someone usually lets us know where we lack in our knowledge. I welcome all input.
Dan Hughes
DanHughes
Registered User
 
Posts: 600
Joined: Mon Jun 30, 2003 4:29 am
Location: Indiana

Re: Problem Pasting Line Blocks

Postby LarryEdwards on Fri May 27, 2011 7:08 pm

Dan's 8/10/07 post immediately above leads to me ask ifis a macro that can be used to force ME to check the Windows clipboard and refresh its own clipboard from there.

The problem I am having with ME not using the Windows program is apparently not associated with any particular program that is misbehavng. What I am doiing is simple cut and paste operations from my web browser (Opera), from Adobe Reader, and from MS Word. These are mainstream programs, and often these operations involving them are not a problem. I therefore think that ME is somehow mishandling the Windows clipboard notifications under some circumstances. I can repeately do the CTRL-C / CTRL-V cycle, but when ME gets off-track it just never reacts to the notification from Windows.
LarryEdwards
Registered User
 
Posts: 74
Joined: Fri Jan 23, 2004 2:18 am
Location: Sitka, Alaska

Re: Problem Pasting Line Blocks

Postby Clay Martin MWI on Tue May 31, 2011 3:23 pm

Hi,
Problem here is ME is checking the windows clip board, just getting the wrong answer. It does not matter what program you cut from, just that it is the windows clip board, not the ME internal one.

This is showing more as folks upgraded to Win 7. I noticed that when I had XP, this might occur 2-3 times a year. Now it is very regular.

I just restart Multi-Edit (ME) and it goes away for a while, and since I use sessions and session restore, it takes a second or two and everything (open files, cursor positions, etc.) is as it was when I closed ME.

This bug is on the top of the bug list.

Sorry for the inconvenience,
Clay
Martin Works Inc
www.martinworks.com
Makers of EZRTools
A MEW Add-on package
for programming in SAS
www.ezrtools.com
User avatar
Clay Martin MWI
Registered User
 
Posts: 712
Joined: Tue Jul 29, 2003 1:02 pm
Location: Susquehanna, PA

Re: Problem Pasting Line Blocks

Postby LarryEdwards on Tue May 31, 2011 6:13 pm

Session manager sounds like it would be a big help for this problem; however, I have never been able to make session manager work. To me, the instructions in the help file are as plain as mud.

In tools/customize/sessions I have tried the global choice (but in trying use sessions I get messages sayng I need to use the encoded choice, which makes no sense to me, because then I can't use the global repository). Whichever choice I use, when I load ME by clicking on a text file and then try to restore the session, I get only that file open (while I had severa open when I closed ME) and the cursor is not where I left it in that file. I have also tried various setting in the lower half of the sessions setup dialog.

Seems to me that sessions is non-functional in my installation. Maybe the problem is that I don't want ME to automatically restore my previous session when I reopen it; only when I tell ME to reopen that session?
LarryEdwards
Registered User
 
Posts: 74
Joined: Fri Jan 23, 2004 2:18 am
Location: Sitka, Alaska

Re: Problem Pasting Line Blocks

Postby Clay Martin MWI on Tue May 31, 2011 6:49 pm

Hi,
Yes, to do what I suggested you need the Session Restore (/SR) on the command line of ME and you don't get that when you just click on a file. I use a quick launch icon with the /SR option. To get sessions working for you you will probably want this setup in Tools-Customize-Sessions:
Encoded status files for each directory, and on Status file path you need:
<User_Path>Sessions

I use sessions tied to projects, but you don't need that, just open some files that you would consider associated (one job, one customer, one directory tree, etc.) then go to File-Session Manager. Enter a useful name and then browse to the directory, then press the Create button. Then to make this work for you, when you start ME (in a way that does not have the /SR option), you need to open the Session Manger, Select the session associated with the work you want to do, and press the select button. This way any subsequent file open/closes (and other info like history lists) you do will be stored in that session. Then just keep an icon (short cut) with the /SR on ME's command line and you can kill ME and quickly restart when the cut/paste problem shows up.

Clay
Martin Works Inc
www.martinworks.com
Makers of EZRTools
A MEW Add-on package
for programming in SAS
www.ezrtools.com
User avatar
Clay Martin MWI
Registered User
 
Posts: 712
Joined: Tue Jul 29, 2003 1:02 pm
Location: Susquehanna, PA

Previous

Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests