diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-16 18:23:21 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-16 18:23:21 +0000 |
commit | dbd1ec43e05c4128a0af1ec5b51313620edb3b51 (patch) | |
tree | a54ee502bbd284d025fe7f72f27550d7a06dce8e /Source/CMTextView.m | |
parent | c1ce60f948e79c6d4dfbaee0f4ccea56888a9be2 (diff) | |
download | sequelpro-dbd1ec43e05c4128a0af1ec5b51313620edb3b51.tar.gz sequelpro-dbd1ec43e05c4128a0af1ec5b51313620edb3b51.tar.bz2 sequelpro-dbd1ec43e05c4128a0af1ec5b51313620edb3b51.zip |
• fixed bug while presetting the mirrored snippets to their counterparts; take into account the relative position of the insertion point (tab trigger)
Diffstat (limited to 'Source/CMTextView.m')
-rw-r--r-- | Source/CMTextView.m | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m index ffd74834..bfc119bd 100644 --- a/Source/CMTextView.m +++ b/Source/CMTextView.m @@ -1609,10 +1609,10 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) // Preset mirrored snippets with according snippet content if(mirroredCounter > -1) { for(i=0; i<=mirroredCounter; i++) { - if(snippetControlArray[snippetMirroredControlArray[i][0]][0] > -1 && snippetControlArray[snippetMirroredControlArray[i][0]][1]) { - [snip replaceCharactersInRange:NSMakeRange(snippetMirroredControlArray[i][1], snippetMirroredControlArray[i][2]) - withString:[snip substringWithRange:NSMakeRange(snippetControlArray[snippetMirroredControlArray[i][0]][0], snippetControlArray[snippetMirroredControlArray[i][0]][1])]]; - snippetMirroredControlArray[i][2] = snippetControlArray[snippetMirroredControlArray[i][0]][1]; + if(snippetControlArray[snippetMirroredControlArray[i][0]][0] > -1 && snippetControlArray[snippetMirroredControlArray[i][0]][1] > 0) { + [snip replaceCharactersInRange:NSMakeRange(snippetMirroredControlArray[i][1]-targetRange.location, snippetMirroredControlArray[i][2]) + withString:[snip substringWithRange:NSMakeRange(snippetControlArray[snippetMirroredControlArray[i][0]][0]-targetRange.location, snippetControlArray[snippetMirroredControlArray[i][0]][1])]]; + snippetMirroredControlArray[i][2] = snippetControlArray[snippetMirroredControlArray[i][0]][1]; } // Adjust successive snippets for(j=0; j<20; j++) @@ -1620,7 +1620,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) snippetControlArray[j][0] += snippetControlArray[snippetMirroredControlArray[i][0]][1]; // Adjust successive mirrored snippets for(j=0; j<=mirroredCounter; j++) - if(i != j && snippetMirroredControlArray[j][1] > snippetMirroredControlArray[i][1]) + if(snippetMirroredControlArray[j][1] > snippetMirroredControlArray[i][1]) snippetMirroredControlArray[j][1] += snippetControlArray[snippetMirroredControlArray[i][0]][1]; } } |