Author Topic: Vim delete-to-marker command not working  (Read 7759 times)

bbeauchaine87408

  • Community Member
  • Posts: 17
  • Hero Points: 1
Vim delete-to-marker command not working
« on: August 12, 2008, 10:40:19 PM »
I just updated to 13.0.1.0 and hotfix_se1301_cumulative.zip.  I started editing a file and found that the Vim delete to marker command seems broken.

To reproduce on my machine:

Edit a file in Vi mode
Ensure that you are in command mode
Set a mark, for instance "ma"
move away from the mark by more than one line
Execute the delete to mark command, for instance "d'a"
The line under the cursor is deleted, but nothing else.

Just checked - seems the yank-to-marker command is broken too.  Ouch.  I use these command pretty heavily in my editing. 
« Last Edit: August 12, 2008, 10:46:19 PM by bbeauchaine87408 »

buggyfunbunny

  • Senior Community Member
  • Posts: 233
  • Hero Points: 4
Re: Vim delete-to-marker command not working
« Reply #1 on: August 13, 2008, 01:00:44 PM »
on win/xp, sp2 with r20, works as expected.  under Tools>Options>Editing>Selections: Extend selection... , Deslect after copy, Inclusive character...  .  No idea what other settings might affect this.  I used d`a (back quote, which is standard vim for to-character-at-marker).  If I used d'a (apostrophe/quote) I get what you describe.  It should, I would think, delete/yank all lines from the cursor's line to the marked line.  Not a command I use, so I don't know.

bbeauchaine87408

  • Community Member
  • Posts: 17
  • Hero Points: 1
Re: Vim delete-to-marker command not working
« Reply #2 on: August 13, 2008, 03:42:36 PM »
My Vim reference shows 't as the extended range command for the position of mark 't'.  Every flavor of Vi on every Unix I've ever used, every emulator (Vim included) I've run on Windows, and every previous version of SlickEdit have behaved the same when using that range as part of a yank or motion command.  It's now in the read-only portion of my muscle memory.

So something changed with the recent update, and looking back on this forum leads me to believe that the macro or emulation layer got a little whacked and was never properly regression tested. 

buggyfunbunny

  • Senior Community Member
  • Posts: 233
  • Hero Points: 4
Re: Vim delete-to-marker command not working
« Reply #3 on: August 13, 2008, 03:52:53 PM »
I downloaded vim 7.2 (brand new version) from the site.  d'a deleted all lines from the cursor to the line with the  a  marker.  d`a deleted all text from the cursor to  a  marker.  SE gets the quote version wrong.

jolney

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Re: Vim delete-to-marker command not working
« Reply #4 on: August 14, 2008, 08:02:10 PM »

FWIW I upgraded to SE2008 for Linux yesterday
and observed exactly the same wrong behavior.

madmuggle

  • Community Member
  • Posts: 30
  • Hero Points: 0
Re: Vim delete-to-marker command not working
« Reply #5 on: August 15, 2008, 12:55:33 AM »
Wow, glad I haven't updated from 13.0.0 yet.  That would kill me.  I use d'<mark> all the time as well as yanking.  I would literally have to stop using slickedit if that stopped working.

buggyfunbunny

  • Senior Community Member
  • Posts: 233
  • Hero Points: 4
Re: Vim delete-to-marker command not working
« Reply #6 on: August 15, 2008, 01:05:16 PM »
I've posted to support.

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Vim delete-to-marker command not working
« Reply #7 on: August 18, 2008, 02:18:26 AM »
Thanks for the report.  I'll look into this as soon as I can...I've been away so I'm not sure of the status of 13.0.2, but even if we can't fix this in time to ship that patch it certainly seems like something that would be hotfixable.  I'll keep you posted.

- Ryan

UPDATE:  This will be fixed in 13.0.2.  If you would like to patch your 13.0.1, go to vi_goto_mark and replace the return statement at the end of the function:

Code: [Select]
return(status);

with:

Code: [Select]
// goto_bookmark now returns >=0 as success
if (status >= 0){
  return 0;
} else {
  return(status);
}

Deleting/yanking from/to marks should now work as it did in 13.0.0.

- Ryan
« Last Edit: August 18, 2008, 08:17:04 PM by Ryan »

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Vim delete-to-marker command not working
« Reply #8 on: August 18, 2008, 09:24:42 PM »
bump

bbeauchaine87408

  • Community Member
  • Posts: 17
  • Hero Points: 1
Re: Vim delete-to-marker command not working
« Reply #9 on: August 18, 2008, 11:48:31 PM »
Thanks.  I had to manually re-load vicmode.e to get SlickEdit to see the change - a shutdown/restart wasn't good enough.

The fix has a side effect that is different from the original behavior.  In previous versions, deleting to a mark and immediately undoing the delete left the mark in the same place in the file as before the deletion.  Now it moves to the place it would be in the file had you not undone the delete.  That small difference I can easily live with - thanks for fixing the macro. 

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Vim delete-to-marker command not working
« Reply #10 on: August 19, 2008, 12:38:57 AM »
Anytime you make a change to a macro module you have to load it.

When we were testing the fix we saw the same behavior with undo as you reported, but we also reproduced said behavior in 12.0.3 and 13.0.0...so I don't think it has anything to do with the fix.  You may just not have noticed it before.  We filed a defect for the marker not being correctly restored. 

Again, thanks for the feedback...I would've hated to release 13.0.2 with this bug.

- Ryan