Author Topic: trouble with Line-selection paste - incorrectly splits lines  (Read 11444 times)

pasters

  • Community Member
  • Posts: 5
  • Hero Points: 0
When I paste a line-selection, it seems to be treated as a char selection and dumping the characters in at the current cursor position. It should drop down a line and paste the whole line in, including smart indenting.

I only recently installed this product. I think this feature worked correctly initially.

Details:
Slickedit 9.0.1.2
Mac OS X 10.5.7
file test.c (c code)
vanilla re-install
XCode emulation

Any ideas?


garion911

  • Senior Community Member
  • Posts: 201
  • Hero Points: 13
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #1 on: June 04, 2009, 07:52:57 PM »
I have the same issue, and a semi-workable solution...

The problem is that OSX's clipboard eats up some of the chars... What you need to do is open up the X11 preferences, and go to the pasteboard tab, and disable syncing.. If you do this, it means that you will not be able to copy/paste to/from OSX windows..

If you need something more atomic, I think the one you need to disable is "Update pasteboard when CLIPBOARD changes".. If you only do that option, you still should be able to copy/paste -from- OSX to Slick, but not the other way around..

This is a royal pain for me, but its the only solution I've come up with. It'd be nice if Slick came up with a different solution for handling it..

pasters

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #2 on: June 04, 2009, 10:52:22 PM »
Thanks Garion911.

My X11 Preferences does not have options related to pasteboard, just Input, Output and Security tabs. Am I looking in the wrong place perhaps?

THanks for any advice you can provide :)

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #3 on: June 05, 2009, 02:17:19 PM »
The term "line selection" refers to a specific kind of selection made in SlickEdit. A line selection is made when a whole line or a number of whole lines are copied as a unit. This is done either by selecting the lines in the left margin area, using the mouse. Or using the various line-oriented select/cut/copy commands.

A whole line that is selected does not necessarily constitute a "line selection". A line selection is determined by the operation that creates it. So, if you select an entire line of text by clicking in column one and dragging to the last character in the line, you will create a character selection--not a line selection. And character selections are pasted at the location of the cursor.

I don't think it's possible to create a line selection outside of SlickEdit.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #4 on: June 05, 2009, 05:34:48 PM »
Also see here.

The editor I used prior to SE treated the system clipboard in this way:
1. If the clipboard ended in a newline, then treat it as a line selection.
2. Else treat it as a character selection.

Also, when it copied text to the system clipboard it also put special extra clipboard formats on the system clipboard to indicate if it was a char, line, or column selection.  That way pasting from one instance of the editor to another instance of the editor would know for sure which kind of selection it was.

pasters

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #5 on: June 05, 2009, 07:14:49 PM »
Today the problem has gone away following a reboot after an X11 hang. I could believe this problem is related to X11. I'll be sure and re-post if it comes back. To clarify what was happening before (and may yet return) -

1) The selection was being made from the same buffer within Slickedit, not from another application
2) I believe I was making a line selection because Slickedit's clipboard browser flagged it as type LINE
3) I am using Xcode emulation. The selection was made with command-C (or by clicking in the left margin, same result). The paste was performed by positioning the cursor within some other line and pressing command-V.


ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #6 on: June 05, 2009, 07:17:24 PM »
@pasters: yup, that should have done a SmartPaste. Let us know if you see it again.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #7 on: June 05, 2009, 08:45:59 PM »
Also see here.

The editor I used prior to SE treated the system clipboard in this way:
1. If the clipboard ended in a newline, then treat it as a line selection.
2. Else treat it as a character selection.

Also, when it copied text to the system clipboard it also put special extra clipboard formats on the system clipboard to indicate if it was a char, line, or column selection.  That way pasting from one instance of the editor to another instance of the editor would know for sure which kind of selection it was.

If you are copying text from SlickEdit to SlickEdit, extra information is placed on the the clipboard which tells SlickEdit it is a line selection.  This doesn't work from other applications. An option for treating clipboards ending with a newline as a line selection is an interesting idea. Probably not a good default setting though.

garion911

  • Senior Community Member
  • Posts: 201
  • Hero Points: 13
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #8 on: June 06, 2009, 03:04:27 AM »
Sorry guys for the delay...

I'm running the newer XQuartz, which adds the  extra options that I mentioned.

This is going to be an on going problem with Slick and the way its interaction with Macs clipboard/pasteboard stuff..

I happen to use line copy all the time in my Brief emualtion (keypad plus/minus), which is why I see this a alot.

rajkej

  • Senior Community Member
  • Posts: 336
  • Hero Points: 14
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #9 on: June 08, 2009, 02:02:48 PM »
I was seeing the same problems mentioned above and filed a bug with SE. I was told to update to XQuartz and the problem hasn't happened as often but it still occurs. What I found was that the list clibpoards (edit menu->list clipboards) was showing the proper line type and would actually paste the clipboard properly (open list clipboards, select the clipboard to paste) but the paste command (either directly calling from the command line or from a keystroke) would not paste properly. e.g. it pastes as if in char mode. I ran the debugger and you can see my analysis below of what is different.

I used the Slick-C debugger and tracked down the following:

In smartp.e, routine smart_paste2(), line 120

The call to _isclipboard_internal(1,isClipboard) returns 0 when I paste by calling 'paste'. This causes the routine paste2() on line 128 to be called and the code is pasted improperly.

When I paste using the clipboard itself (menu edit, list clipboards, choose and select the item) then the call to _isclipboard_internal(1,isClipboard) returns 1 and the ext_smartpaste() routine on line 134 is called and the code is pasted correctly.

The difference in the call to _isclipboard_internal() happens to be the call to _clipboard_format().

When I call paste(), _clipboard_format() returns ''

When I use the clipboard list, _clipboard_format() returns "pid=xxxx line"

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #10 on: June 08, 2009, 03:03:57 PM »
In the case of List Clipboards command, the system clipboard gets set to the selected clipboard item as soon as you hit the enter key and then the paste occurs.  The _clipboard_format is returning a snippet that identifies that SlickEdit last set the system clipboard, returning the process id and selection type (LINE).  In the other case, something other than SlickEdit is modifying the clipboard and clearing the SlickEdit identifiers.  I'm not exactly sure why, but it appears it does have something to do with the X11 and Pasteboard synchronization.

rajkej

  • Senior Community Member
  • Posts: 336
  • Hero Points: 14
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #11 on: June 08, 2009, 07:36:13 PM »
The interesting part about this is that once it happens, all future cuts, copies, etc have the problem.  So whatever actually happens, there is a trigger and it won't stop happening without restarting X11.

Yet another reason to make an actual port of SE to the MAC platform rather than using X11 :-)

pasters

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #12 on: June 08, 2009, 08:19:11 PM »
For reference I am running XQuartz 2.1.6 (xorg-server 1.4.2-apple33) under MAC OS X 10.5.7.

pasters

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #13 on: June 11, 2009, 10:32:49 PM »
It has been brought to my attention that the newest X11 for OS X is considerably better than the version which ships with Leopard. It is available from http://xquartz.macosforge.org/trac/wiki/X112.3.3.2 I'll try this and see if it makes a difference to the occasional line-selection paste fail problem.

rajkej

  • Senior Community Member
  • Posts: 336
  • Hero Points: 14
Re: trouble with Line-selection paste - incorrectly splits lines
« Reply #14 on: June 15, 2009, 04:38:26 PM »
That's the version I've been running -- XQuartz 2.3.3.2 (xorg-server 1.4.2-apple42). You still have to turn off "update pasteboard when clipboard changes" setting or you will get the error.