Author Topic: [BUG] Multi-line paste _broken_ in v22 RC2 & RC3 (linux64 but not Mac).  (Read 891 times)

jwiede

  • Community Member
  • Posts: 97
  • Hero Points: 12
Bug is as follows:

Given the following code in a V22 C/C++ mode window, and editor options set to paste lines "before"...

Code: [Select]
  case GLFW_KEY_ESCAPE:
    glfwSetWindowShouldClose( window, GL_TRUE );
    break;
  case GLFW_KEY_SPACE:
    rotateX = 0;
    rotateY = 0;
    rotateZ = 0;
    pointSize = 2.0f;
    break;
  case GLFW_KEY_W:
    rotateX += 0.01;
    break;
  case GLFW_KEY_Q:
    rotateX -= 0.01;
    break;
  case GLFW_KEY_S:
    rotateY += 0.01;
    break;

Selecting the following lines of code (using keyboard) so that cursor is at column 0 on following line ("case GLFW_KEY_Q:")...

Code: [Select]
  case GLFW_KEY_W:
    rotateX += 0.01;
    break;

...when I then press ctrl-c (to copy), and subsequently press ctrl-v (to replicate, pasting the lines again), instead of the expected result I get the following result...

Code: [Select]
  case GLFW_KEY_W:
    rotateX += 0.01;
    break;
  case GLFW_KEY_W:
    rotateX += 0.01;
    break;

  case GLFW_KEY_Q:
    rotateX -= 0.01;
    break;

...with the cursor between the "a" and "s" in case, on the "  case GLFW_KEY_Q:" line.  Obviously, from the point on, further pasting causes corruption of the code (another paste puts the pasted lines inbetween the "a" and "s", effectively truncating the prior line at "ca" and leaving the following lines beginning with "se GLFW_KEY_Q:").

I was unable to repeat this in either v22 RC2 or RC3 on Mac, so believe it may be something specific to the v22 RC2/3 linux64 version.

Please let me know if I can provide additional info to help track down this bug.  IMO, v22 cannot ship in this state, corrupting code by simple multi-line pasting is atrocious misbehavior.  I can probably figure out a way to take a video of the misbehavior or screencast or something if needed, and likewise can provide settings if needed (though settings were only slightly modified from default, and only big change w.r.t. cut/paste was to make multi-line pastes "before" mode instead of "after").

Thanks!

-John W.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4611
  • Hero Points: 365
Re: [BUG] Multi-line paste _broken_ in v22 RC2 & RC3 (linux64 but not Mac).
« Reply #1 on: October 06, 2017, 12:15:28 pm »
Unable to reproduce this. I even tried turning on Beautify on paste. If you have Beautify on paste on, try turning that off. There could be a subtle difference with the test case and the beautifier profile.

Try a clean config to see if that makes a difference:

vs +new -sc <new-config-directory>

Please post a small sample as an attachment (not inline) just in case there's some subtle difference with the test case. Also please post your user.cfg.xml. That way, if the problem is specific to your beautifier profile settings or some other setting, we will have them. Thanks
« Last Edit: October 06, 2017, 02:06:17 pm by Clark »

jwiede

  • Community Member
  • Posts: 97
  • Hero Points: 12
Re: [BUG] Multi-line paste _broken_ in v22 RC2 & RC3 (linux64 but not Mac).
« Reply #2 on: October 07, 2017, 12:57:23 am »
Here's my user.cfg.xml...


jwiede

  • Community Member
  • Posts: 97
  • Hero Points: 12
Re: [BUG] Multi-line paste _broken_ in v22 RC2 & RC3 (linux64 but not Mac).
« Reply #3 on: October 07, 2017, 01:00:50 am »
I tried using a new/clean config (via '-sc new-cfg') and while the paste didn't overwrite the sentence as it had previously, it was still misplacing the cursor such that spare lines, etc. began appearing after the second such pasting.  I checked and do not have "beautify-on-paste/dnd" turned on.  No clue what's going on, but hope y'all can figure it out.

Again, this is a problem I've only been able to repro in Linux-64 (but have, well had, a 100% repro here).  I do not see it on Mac vs.

Thanks!

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4611
  • Hero Points: 365
Re: [BUG] Multi-line paste _broken_ in v22 RC2 & RC3 (linux64 but not Mac).
« Reply #4 on: October 08, 2017, 01:55:47 pm »
Reproduced with your config. You have beautify on paste turned on. Turn it off for now. Tools>Options>Languages>Application Languages>C/C++>General and uncheck "Beautify on paste or drag and drop".

We will look into this further.

NOTE: With this user.cfg.xml, I can reproduce the problem on Windows and Mac too.
« Last Edit: October 08, 2017, 02:07:12 pm by Clark »

jwiede

  • Community Member
  • Posts: 97
  • Hero Points: 12
Re: [BUG] Multi-line paste _broken_ in v22 RC2 & RC3 (linux64 but not Mac).
« Reply #5 on: October 11, 2017, 05:38:45 pm »
I tried using a new/clean config (via '-sc new-cfg') and while the paste didn't overwrite the sentence as it had previously, it was still misplacing the cursor such that spare lines, etc. began appearing after the second such pasting.  I checked and do not have "beautify-on-paste/dnd" turned on.  No clue what's going on, but hope y'all can figure it out.

As I noted above, I was able to partially reproduce the problem with _clean_ config and with beautify-on-paste turned off.  After the first pasting the cursor is a few chars into the bottom line, and the more you paste the more it crawls forward.  I suspect whatever causes that cursor crawl even with clean configs is at least a partial contributor to the problem.

When I referred to having beautify-on-paste turned off, I was referring to when reproducing with clean configs, and again, that it did (reliably) partially manifest here even with clean configs is telling. 

Try the experiment I cited with clean configs on linux64, and you should be able to see the cursor "crawling" forward after the multi-line paste instead of remaining in column 0 (zero) as it should.