| Line 25... |
Line 25... |
| 25 |
* http://www.gnu.org/copyleft/gpl.html. You can also obtain it by
|
25 |
* http://www.gnu.org/copyleft/gpl.html. You can also obtain it by
|
| 26 |
* writing to the Free Software Foundation, Inc., 59 Temple Place,
|
26 |
* writing to the Free Software Foundation, Inc., 59 Temple Place,
|
| 27 |
* Suite 330, Boston, MA 02111-1307 USA.
|
27 |
* Suite 330, Boston, MA 02111-1307 USA.
|
| 28 |
*
|
28 |
*
|
| 29 |
* Created by Simon Urbanek on 5/11/05.
|
29 |
* Created by Simon Urbanek on 5/11/05.
|
| 30 |
* $Id: RTextView.m 6247 2012-08-28 11:29:18Z bibiko $
|
30 |
* $Id: RTextView.m 6438 2013-02-06 20:39:41Z urbaneks $
|
| 31 |
*/
|
31 |
*/
|
| 32 |
|
32 |
|
| 33 |
|
33 |
|
| 34 |
#import "RTextView.h"
|
34 |
#import "RTextView.h"
|
| 35 |
#import "HelpManager.h"
|
35 |
#import "HelpManager.h"
|
| Line 852... |
Line 852... |
| 852 |
else
|
852 |
else
|
| 853 |
newString = [indentString stringByAppendingString:
|
853 |
newString = [indentString stringByAppendingString:
|
| 854 |
[[textViewString substringWithRange:blockRange]
|
854 |
[[textViewString substringWithRange:blockRange]
|
| 855 |
stringByReplacingOccurrencesOfString:@"\n" withString:[NSString stringWithFormat:@"\n%@", indentString]]];
|
855 |
stringByReplacingOccurrencesOfString:@"\n" withString:[NSString stringWithFormat:@"\n%@", indentString]]];
|
| 856 |
|
856 |
|
| 857 |
// Register the indent for undo
|
- |
|
| 858 |
[self shouldChangeTextInRange:blockRange replacementString:newString];
|
- |
|
| 859 |
|
- |
|
| 860 |
[self replaceCharactersInRange:blockRange withString:newString];
|
- |
|
| 861 |
|
857 |
|
| - |
|
858 |
// Do insertion via insertText in order to ensure proper layouting
|
| - |
|
859 |
[self setSelectedRange:blockRange];
|
| - |
|
860 |
[self insertText:newString];
|
| 862 |
[self setSelectedRange:NSMakeRange(blockRange.location, [newString length])];
|
861 |
[self setSelectedRange:NSMakeRange(blockRange.location, [newString length])];
|
| 863 |
|
862 |
|
| 864 |
if(blockRange.length == [newString length])
|
863 |
if(blockRange.length == [newString length])
|
| 865 |
return NO;
|
864 |
return NO;
|
| 866 |
else
|
865 |
else
|
| Line 958... |
Line 957... |
| 958 |
newString = [[textViewString substringWithRange:NSMakeRange(blockRange.location+leading, blockRange.length-leading)]
|
957 |
newString = [[textViewString substringWithRange:NSMakeRange(blockRange.location+leading, blockRange.length-leading)]
|
| 959 |
stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"\r%@", indentString] withString:@"\r"];
|
958 |
stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"\r%@", indentString] withString:@"\r"];
|
| 960 |
else
|
959 |
else
|
| 961 |
newString = [[textViewString substringWithRange:NSMakeRange(blockRange.location+leading, blockRange.length-leading)]
|
960 |
newString = [[textViewString substringWithRange:NSMakeRange(blockRange.location+leading, blockRange.length-leading)]
|
| 962 |
stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"\n%@", indentString] withString:@"\n"];
|
961 |
stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"\n%@", indentString] withString:@"\n"];
|
| 963 |
|
962 |
|
| 964 |
// Register the unindent for undo
|
963 |
// Do insertion via insertText in order to ensure proper layouting
|
| 965 |
[self shouldChangeTextInRange:blockRange replacementString:newString];
|
964 |
[self setSelectedRange:blockRange];
|
| 966 |
|
- |
|
| 967 |
[self replaceCharactersInRange:blockRange withString:newString];
|
965 |
[self insertText:newString];
|
| 968 |
|
- |
|
| 969 |
[self setSelectedRange:NSMakeRange(blockRange.location, [newString length])];
|
966 |
[self setSelectedRange:NSMakeRange(blockRange.location, [newString length])];
|
| 970 |
|
967 |
|
| 971 |
if(blockRange.length == [newString length])
|
968 |
if(blockRange.length == [newString length])
|
| 972 |
return NO;
|
969 |
return NO;
|
| 973 |
else
|
970 |
else
|