Author Topic: Brief Mode Replace Bug  (Read 2741 times)

mkatz

  • Community Member
  • Posts: 90
  • Hero Points: 2
Brief Mode Replace Bug
« on: September 20, 2010, 07:15:04 pm »
Preserve case in replace appears not be working properly.

Procedure:

Start SlickEdit as a clean install (-sc option)
Select Brief Emulation
Click on finish
Install hotfix 3 (hotfix_se1501_3_cumulative) - Not necessary but included for completion
ALT-E (edit file)
Click on Browse
Click on Ok
enter 'Test'
Click on Open
Type the following three lines:
    ModuleInit
    ModuleProcess
    ModuleStart
F6 (Replace)
Type 'Module' in the Search For box (exact case)
Type 'HeartBeat' in the Replace with box (exact case)
check Wrap at beginning/end
check Preserve case
Click on Replace All

Actual Results:
    HeartbeatInit
    HeartbeatProcess
    HeartbeatClose

Expected Results:
   HeartBeatInit
   HeartBeatProcess
   HeartBeatClose


Configuration:

SlickEdit Version 15.0.1.3

Serial number: WB936319
Licensed number of users: Single user
License file: C:\Documents and Settings\All Users\Application Data\slickedit\15\slickedit.lic

Build Date: August 04, 2010
Emulation: Brief

OS: Windows XP
OS Version: 5.01.2600  Service Pack 3
Memory: 35% Load, 81MB/2097MB Physical, 137MB/2097MB Virtual
Shell Info: C:\WINDOWS\system32\cmd.exe /q
Screen Size: 1680 x 1050

Project Type: No project open
Language: . (Plain Text)

Installation Directory: C:\Program Files\SlickEditV15.0.1\ (non-removable drive,NTFS,236790MB free)
Configuration Directory: c:\temp\15.0.1\ (non-removable drive,NTFS,236790MB free)
Spill File: C:\Documents and Settings\Mike\Local Settings\Temp\$slk.0 (non-removable drive,NTFS,236790MB free)

Hotfixes:
c:\temp\15.0.1\hotfixes\hotfix_loader_se15013_3.zip (Revision: 3)
c:\temp\15.0.1\hotfixes\hotfix_se1501_3_cumulative.zip (Revision: 3)



ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Brief Mode Replace Bug
« Reply #1 on: September 21, 2010, 02:03:28 pm »
Actually, I think it's working correctly. "Preserve case" attempts to match the upper/lowercase style of the matched term and apply it to the replacement term. Since "Module" is capitalized at the beginning only, "HeartBeat" is changed to "Heartbeat".

Here's a bit from the User Guide:
Quote
(Replace commands only) Preserve case. When specified, each occurrence found is checked for all lowercase, all uppercase, first word capitalized, or mixed case. The replace string is converted to the same case as the occurrence found except when the occurrence found is mixed case (possibly multiple capitalized words). In this case, the replace string is used without modification. </para>

This is from the "Find and Replace Commands" section. The docs that describe the "Preserve case" checkbox say it does a "case-sensitive search and replace operation". That's very misleading, and I will change it to match the description from above.

So, in this case, you should be sure not to check "Preserve case".

mkatz

  • Community Member
  • Posts: 90
  • Hero Points: 2
Re: Brief Mode Replace Bug
« Reply #2 on: September 21, 2010, 02:06:20 pm »
It doesn't produce the desired results that way either.  That's why I checked the preserve case box.

Thanks....

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Brief Mode Replace Bug
« Reply #3 on: September 21, 2010, 03:01:07 pm »
What results does it give without "Preserve case" checked?

I just ran the test and got this:
Quote
HeartBeatInit
HeartBeatProcess
HeartBeatStart

mkatz

  • Community Member
  • Posts: 90
  • Hero Points: 2
Re: Brief Mode Replace Bug
« Reply #4 on: September 21, 2010, 05:44:42 pm »
I got the same (successful) results.  I had turned Preserve Case on for some reason and now I don't remember why.  If I figure it out I will repost.

Thank you...