Author Topic: Control-C copy/copy/paste works funny  (Read 6972 times)

Seaxouri

  • Community Member
  • Posts: 8
  • Hero Points: 0
Control-C copy/copy/paste works funny
« on: October 04, 2007, 11:03:54 pm »
So I tried this with a fresh Config folder and I see this happen. Pretty much all default settings with no changed scripts. It happens on all 12.0.x versions. Never happened for me on 11.x or earlier.

I use Microsoft Visual Dev standard keys, so control-C is copy to clipboard, control-V is paste, etc.

1) Open a new text document and put two lines, one with AAAA in it the second with BBBB in it.
2) Using mouse or keyboard, highlight/select the 4 A's and press control-C to copy to the clipboard
3) Using mouse or keyboard, highlight/select the 4 B's and press control-C to copy to the clipboard
4) At the end of the file press control-V to paste the contents of the clipboard

What I expect to see is the BBBB's get pasted. What happens is the AAAA's from the first copy get pasted. If you continue to press control-V, you will keep getting A's UNTIL you press control-C again. At this point control-V's will then spit out my BBBBs UNTIL I press control-C a third time, at which point control-V's spit out nothing.

This does not happen on my coworkers SlickEdit (v12.0.2) but he does not run the Microsoft style. I think it has to do with that.

I tried setting the number of clipboards to 1, but it doesn't help. There is a 'hidden' clipboard somewhere that you cannot access that is being pasted from.

This drives me absolutely nuts!

hs2

  • Senior Community Member
  • Posts: 2738
  • Hero Points: 288
Re: Control-C copy/copy/paste works funny
« Reply #1 on: October 05, 2007, 01:22:58 am »
Did you verify the Slick internal (primary) clipboards ('list-clipboards' on cmdline or 'Edit>List Clipboards) ?
However, sometimes it happens (at least to me) that the clipboard list gets corrupted.
Just try a 'reset-clipboards' on cmdline and check if the problem persists.

HS2

Seaxouri

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Control-C copy/copy/paste works funny
« Reply #2 on: October 05, 2007, 03:18:03 pm »
reset-clipboards does not help.

I can pull up the clipboard-list just fine. As stated, even with it set to ONE clipboard, I only see the BBBBs listed in the clipboard list, yet when I press control-V, the AAAA's get pasted magically from some 'hidden' clipboard, not shown in the clipboard list.
« Last Edit: October 05, 2007, 03:19:37 pm by Seaxouri »

Seaxouri

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Control-C copy/copy/paste works funny
« Reply #3 on: October 05, 2007, 03:22:30 pm »
I just verified that this does NOT happen if I set the Emulation to SlickEdit mode. It happens only when I set to CUA or Microsoft mode.

I would have hoped this was tested since CUA is the default mode, but apparently it wasn't.

hs2

  • Senior Community Member
  • Posts: 2738
  • Hero Points: 288
Re: Control-C copy/copy/paste works funny
« Reply #4 on: October 05, 2007, 03:37:31 pm »
Strange .. last idea:
Compare the keybindings of CTRL-C/V for each emulation if there is a difference. HS2

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Control-C copy/copy/paste works funny
« Reply #5 on: October 05, 2007, 04:11:27 pm »
I am not able to replicate the issue you are describing with a default installation and fresh config in any 12.0.x releases. What platform are you on and which emulation are you using exactly?  Can you record and macro of your steps and see what commands are being called?  You may also want to temporarily disable auto-restore of the clipboard (Tools>Options>General...) and restart to see if the clipboard buffer is corrupted (though reset-clipboards command should have cleared that). It might be best to start a support case with this by contacting support@slickedit.com and work with them on the issue.

Seaxouri

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Control-C copy/copy/paste works funny
« Reply #6 on: October 05, 2007, 05:44:23 pm »
Unfortunately recording a macro and playing it back does not yield the same results as when I recorded it. Here is the macro, I tried it twice, once using 'Home/End' keys, the other time using Arrow Keys for selection.

Playing this macro back wont do anyone much good, it just has error messages about not being able to find the clipboard.

This tool is just getting buggier and buggier and biggier.

Also, I could not edit my recorded macro and get it to recompile, even after deleting the .ex file! The only way I could get it to do that was to make a dummy macro called foo which did nothing.. then SE recompiled my .e file into a .ex file. Other than that it must have cached a copy of the .ex file somewhere and used that. Bizarre.

Also, I have clipboard auto-restore turned off, always have.

Notice how if you select any text then copy it to the clipboard you don't see the message "X Lines copied to clipboard", but if you press the copy-to-clipboard button a second time, you will see the message? I think everyone has this bug.

I just get irritated with customer support. They usually wind up telling me the problem is not recreatable and toss my requests in a bit bucket. Those are tracked by management and all they worry about is zeroing out the defects, not actually fixing anything. Not for a lowly developer like myself. Now if I were Coca-Cola or Dell, then they would actually listen to me. Those developers that actually care about fixing bugs will read the forums here. The chances of my official request making it thru the layers of support to get to a real developer are slim to none. I live this game in real life so I know it well.

Oh if I could just go back to SlickEdit 4, or 6 or 7! Back then those versions worked tight and clean. I think SE12 is the Win98ME of Windows.

Code: [Select]
#include "slick.sh"
_command cutpastebug() name_info(','VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL)
{
   _macro('R',1);
   keyin("aaa");
   split_insert_line();
   keyin("bbb");
   split_insert_line();
   split_insert_line();
   split_insert_line();
   split_insert_line();
   split_insert_line();
   page_up();
   deselect();
   _select_char('','E');
   end_line();
   select_it('CHAR','','E');
   copy_to_clipboard();
   cursor_down();
   begin_line_text_toggle();
   deselect();
   _select_char('','E');
   end_line();
   select_it('CHAR','','E');
   copy_to_clipboard();
   page_down();
   paste();
   split_insert_line();
   paste();
   split_insert_line();
   copy_to_clipboard();
   split_insert_line();
   paste();
   split_insert_line();
   paste();
   split_insert_line();
   copy_to_clipboard();
   split_insert_line();
   paste();
   split_insert_line();
   paste();
}

_command cutpastebug2() name_info(','VSARG2_MACRO|VSARG2_MARK|VSARG2_READ_ONLY|VSARG2_ICON|VSARG2_REQUIRES_EDITORCTL)
{
   _macro('R',1);
   keyin("aaa");
   split_insert_line();
   keyin("bbb");
   split_insert_line();
   split_insert_line();
   cursor_up(3);
   deselect();
   _select_char('','E');
   cursor_right(3);
   select_it('CHAR','','E');
   copy_to_clipboard();
   cursor_down();
   cursor_left(3);
   deselect();
   _select_char('','E');
   cursor_right(3);
   select_it('CHAR','','E');
   copy_to_clipboard();
   cursor_down(2);
   paste();
   split_insert_line();
   cursor_up(4);
   deselect();
   _select_char('','E');
   cursor_right(3);
   select_it('CHAR','','E');
   copy_to_clipboard();
   cursor_down(4);
   paste();
   split_insert_line();
   copy_to_clipboard();
   split_insert_line();
   paste();
}
_command foo() name_info(','VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL)
{
   _macro('R',1);
}
« Last Edit: October 05, 2007, 05:54:53 pm by Seaxouri »

Seaxouri

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Control-C copy/copy/paste works funny
« Reply #7 on: October 05, 2007, 06:06:47 pm »
Also, I use Windows v12.0.3.

I tried changing to SlickEdit mode and just changing the copy-to-clipboard bind to control-C and I can reproduce the problem.

Sometimes it works the first pass. But after a few pastes, go up to your AAAA and copy it to clipboard, then come back down and try to paste it, you will eventually get to a point where you expect it to paste AAAAs and it pastes BBBBs, or vice versa. Once you see that, pressing control-C again will 'move to the next clipboard' and you will see the right thing paste out.

I see they rewrote the cut/paste macros a lot this last release, especially with SmartPaste.

Lisa

  • Senior Community Member
  • Posts: 238
  • Hero Points: 23
  • User-friendly geek-speak translator extraordinaire
Re: Control-C copy/copy/paste works funny
« Reply #8 on: October 05, 2007, 08:02:44 pm »
I see they rewrote the cut/paste macros a lot this last release, especially with SmartPaste.

Hi Seaxouri. Just wanted to point out that we ARE here...I know I read every post on the forums and most of the developers do too at some point. So no need to speak about us in third person. :)

Seaxouri

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Control-C copy/copy/paste works funny
« Reply #9 on: October 08, 2007, 10:43:05 pm »
Well I think I figured it out and its time to eat a little crow. Hopefully this may help someone else, though.

I decided I would try and kill all other applications/processes running on my machine. Of course there are a lot of them required by my company, etc to be running, so shutting them down long term was not an option. I tried shutting things down one at a time but it became time consuming, so I killed every process that didn't look like it *needed* to be running for me to have a basic OS. After doing lots of killing, the problem seemed to disappear.

So I rebooted and the problem seemed to disappear for a little while.

Then it reappeared, so I decided to go thru the one-shot kill method again. An hour later I finally discovered that it was my VNC Viewer. I use it to connect to my local Linux box (lots of Linux dev) and it has hooks to the clipboard (send/recv). There is an option to disable 'sending clipboard events to server', which I disabled, and now things appear to be working well. The macro playback is working correctly too.

Still not sure why it didn't happen before on older SlickEdits, maybe there were different clipboards, or maybe I used a different version of VNC, like tightVNC. I really do not recall.

My client is:Windows RealVNC 4.1.2
My server is: xorg-X11-Xvnc-6.9.0-50.14

My coworker is running FC6 which has RealVNC 4.1.2 as its server and he does not see the problem. However, when he connects his Windows vnc client to my Linux vncserver, the problem *is* seen on his machine.

Anyhow, hope this helps someone in the future.
« Last Edit: October 09, 2007, 03:29:00 pm by Seaxouri »

ChuckInDodgeville

  • Community Member
  • Posts: 25
  • Hero Points: 1
Re: Control-C copy/copy/paste works funny
« Reply #10 on: February 07, 2008, 10:26:01 pm »
Just FYI, this did help someone else.  I had Control-V closing/crashing Slick (Linux, 12.0.3).  This thread reminded me that my clipboard was coming from "synergy", the KVM tool.  Somehow Synergy puts something in the clipboard that kills Slick.  But knowing that, the work around (paste in another app first) is easy enough.