diff --git a/Library/macOSRichTextEditor.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Library/macOSRichTextEditor.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..919434a
--- /dev/null
+++ b/Library/macOSRichTextEditor.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/Library/macOSRichTextEditor.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Library/macOSRichTextEditor.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/Library/macOSRichTextEditor.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/Library/macOSRichTextEditor/Source/RichTextEditor.h b/Library/macOSRichTextEditor/Source/RichTextEditor.h
index 72084bd..e7f1ea3 100755
--- a/Library/macOSRichTextEditor/Source/RichTextEditor.h
+++ b/Library/macOSRichTextEditor/Source/RichTextEditor.h
@@ -129,6 +129,10 @@ typedef NS_OPTIONS(NSUInteger, RichTextEditorShortcut) {
/// Minimum font size. Defaults to 10.0f.
@property CGFloat minFontSize;
+/// true if tab should always indent and shift+tab should always outdent the current paragraph(s);
+/// false to let the tab key be used as normal
+@property BOOL tabKeyAlwaysIndentsOutdents;
+
/// Pasteboard type string used when copying text from this NSTextView.
+(NSString*)pasteboardDataType;
diff --git a/Library/macOSRichTextEditor/Source/RichTextEditor.m b/Library/macOSRichTextEditor/Source/RichTextEditor.m
index 7c94569..afec1ea 100644
--- a/Library/macOSRichTextEditor/Source/RichTextEditor.m
+++ b/Library/macOSRichTextEditor/Source/RichTextEditor.m
@@ -184,6 +184,10 @@ typedef NS_ENUM(NSInteger, ParagraphIndentation) {
if (self.delegate_interceptor.receiver && [self.delegate_interceptor.receiver respondsToSelector:@selector(textView:shouldChangeTextInRange:replacementString:)]) {
return [self.delegate_interceptor.receiver textView:textView shouldChangeTextInRange:affectedCharRange replacementString:replacementString];
}
+ if (self.tabKeyAlwaysIndentsOutdents && [replacementString isEqualToString:@"\t"] && affectedCharRange.length == 0) {
+ //[self userSelectedIncreaseIndent];
+ //return NO;
+ }
return YES;
}
@@ -1392,6 +1396,14 @@ typedef NS_ENUM(NSInteger, ParagraphIndentation) {
(enabledShortcuts == RichTextEditorShortcutAll || enabledShortcuts & RichTextEditorShortcutIncreaseIndent)) {
[self userSelectedIncreaseIndent];
}
+ else if (self.tabKeyAlwaysIndentsOutdents && keyChar == '\t' && !commandKeyDown && !shiftKeyDown &&
+ (enabledShortcuts == RichTextEditorShortcutAll || enabledShortcuts & RichTextEditorShortcutIncreaseIndent)) {
+ [self userSelectedIncreaseIndent];
+ }
+ else if (self.tabKeyAlwaysIndentsOutdents && (keyChar == '\t' || keyChar == 25) && !commandKeyDown && shiftKeyDown &&
+ (enabledShortcuts == RichTextEditorShortcutAll || enabledShortcuts & RichTextEditorShortcutIncreaseIndent)) {
+ [self userSelectedDecreaseIndent];
+ }
else if (!([self.rteDelegate respondsToSelector:@selector(richTextEditor:keyDownEvent:)] && [self.rteDelegate richTextEditor:self keyDownEvent:event])) {
[self sendDelegatePreviewChangeOfType:RichTextEditorPreviewChangeKeyDown];
[super keyDown:event];