Sublime Forum

Bug: Replace w/ Preserve Case Inequal Lengths

#1

ST2 build 2139 (OSX 10.7)

The replace command’s “preserve case” feature does not work correctly when the replacement string length is not equal to the search string’s length.

Consider the following text in the buffer:
foobar
fooBar
FooBar
FOOBAR

Then configure the Replace command as follows:
Find What: FooBar
Replace With: CandyBar
Preserve Case: ON
Case Sensitive: OFF

Running the above replace command on the above input results in:
candybar
canDybar
CanDybar
CANDYBAR

I would expect the output to look like this:
candybar
candyBar
CandyBar
CANDYBAR

0 Likes