Skip to content

Commit

Permalink
rename SourceCodeEditorView -> SourceEditorView
Browse files Browse the repository at this point in the history
  • Loading branch information
pebble8888 committed Jun 10, 2019
1 parent 36aec01 commit cf20d82
Show file tree
Hide file tree
Showing 24 changed files with 306 additions and 306 deletions.
2 changes: 1 addition & 1 deletion XVim2-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef XVim2_Bridging_Header_h
#define XVim2_Bridging_Header_h

#import "XVim2/Xcode/SourceCodeEditorViewProxy.h"
#import "XVim2/Xcode/SourceEditorViewProxy.h"
#import "XVim2/Helper/rd_route.h"
#import "XVim2/Helper/Logger.h"

Expand Down
76 changes: 38 additions & 38 deletions XVim2.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions XVim2/UnitTest/XVimTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#import "XVimTestCase.h"
#import "Logger.h"
#import "SourceCodeEditorViewProxy.h"
#import "SourceCodeEditorViewProxy+XVim.h"
#import "SourceEditorViewProxy.h"
#import "SourceEditorViewProxy+XVim.h"
#import "XVimKeyStroke.h"
#import "XVimWindow.h"
#import "XcodeUtils.h"
Expand Down
2 changes: 1 addition & 1 deletion XVim2/UnitTest/XVimTester.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "XVimTester.h"
#import "Logger.h"
#import "SourceCodeEditorViewProxy.h"
#import "SourceEditorViewProxy.h"
#import "XVimKeyStroke.h"
#import "XVimTestCase.h"
#import "XcodeUtils.h"
Expand Down
2 changes: 1 addition & 1 deletion XVim2/XVim/Evaluator/MotionArgument/XVimZEvaluator.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "XVimZEvaluator.h"
#import "Logger.h"
#import "SourceCodeEditorViewProxy.h"
#import "SourceEditorViewProxy.h"
#import "XVimMotionEvaluator.h"

@implementation XVimZEvaluator
Expand Down
2 changes: 1 addition & 1 deletion XVim2/XVim/Evaluator/Operators/XVimDeleteEvaluator.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "XVimInsertEvaluator.h"
#import "XVimWindow.h"
#import "Logger.h"
#import "SourceCodeEditorViewProxy.h"
#import "SourceEditorViewProxy.h"
#import "XVim.h"
#import "XVimTextObjectEvaluator.h"

Expand Down
2 changes: 1 addition & 1 deletion XVim2/XVim/Evaluator/XVimCommandLineEvaluator.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "XVimCommandLineEvaluator.h"
#import "Logger.h"
#import "SourceCodeEditorViewProxy.h"
#import "SourceEditorViewProxy.h"
#import "SourceViewProtocol.h"
#import "XVim.h"
#import "XVimCommandField.h"
Expand Down
2 changes: 1 addition & 1 deletion XVim2/Xcode/IDEWorkspaceTabController+XVim.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "IDEWorkspaceTabController+XVim.h"
#import "Logger.h"
#import "NSObject+Swizzle.h"
#import "SourceCodeEditorViewProxy.h"
#import "SourceEditorViewProxy.h"
#import "XVimWindow.h"
#import "XcodeUtils.h"
#import <IDEKit/IDEComparisonEditorSubmode.h>
Expand Down
8 changes: 4 additions & 4 deletions XVim2/Xcode/SourceEditorDataSourceWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ class SourceEditorDataSourceWrapper: NSObject {
private let fpLineTerminatorLength
= function_ptr_from_name("_$s12SourceEditor0ab4DataA0C27lineTerminatorLengthForLineyS2iF", nil)

private weak var sourceCodeEditorViewWrapper: SourceCodeEditorViewWrapper?
private weak var sourceEditorViewWrapper: SourceEditorViewWrapper?

private var dataSource: AnyObject? {
return sourceCodeEditorViewWrapper?.dataSource
return sourceEditorViewWrapper?.dataSource
}

@objc
public init(withSourceCodeEditorViewWrapper wrapper: SourceCodeEditorViewWrapper) {
sourceCodeEditorViewWrapper = wrapper
public init(withSourceEditorViewWrapper wrapper: SourceEditorViewWrapper) {
sourceEditorViewWrapper = wrapper
}

@objc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//
// SourceCodeEditorViewProxy+Operations.h
// SourceEditorViewProxy+Operations.h
// XVim2
//
// Created by Ant on 02/10/2017.
// Copyright © 2017 Shuichiro Suzuki. All rights reserved.
//

#import "SourceCodeEditorViewProxy.h"
#import "SourceEditorViewProxy.h"
#import <Foundation/Foundation.h>

@interface SourceCodeEditorViewProxy (Operations) <SourceViewOperationsProtocol>
@interface SourceEditorViewProxy (Operations) <SourceViewOperationsProtocol>
- (BOOL)xvim_delete:(XVimMotion*)motion withMotionPoint:(NSUInteger)motionPoint andYank:(BOOL)yank;
- (BOOL)xvim_delete:(XVimMotion*)motion andYank:(BOOL)yank;
@end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// SourceCodeEditorViewProxy+Operations.m
// SourceEditorViewProxy+Operations.m
// XVim2
//
// Created by Ant on 02/10/2017.
Expand All @@ -8,14 +8,14 @@

#import "NSString+VimHelper.h"
#import "NSTextStorage+VimOperation.h"
#import "SourceCodeEditorViewProxy+Operations.h"
#import "SourceCodeEditorViewProxy+Yank.h"
#import "SourceCodeEditorViewProxy+XVim.h"
#import "SourceEditorViewProxy+Operations.h"
#import "SourceEditorViewProxy+Yank.h"
#import "SourceEditorViewProxy+XVim.h"
#import "XVim.h"
#import "XVimMotion.h"
#import "XVimOptions.h"

@interface SourceCodeEditorViewProxy ()
@interface SourceEditorViewProxy ()
@property NSUInteger selectionBegin;
@property NSUInteger insertionPoint;
@property NSUInteger preservedColumn;
Expand All @@ -34,7 +34,7 @@ - (void)xvim_registerPositionForUndo:(NSUInteger)pos;
- (NSRange)xvim_currentNumber;
@end

@implementation SourceCodeEditorViewProxy (Operations)
@implementation SourceEditorViewProxy (Operations)

#pragma mark - COPYMOVE
- (void)xvim_copymove:(XVimMotion*)motion withMotionPoint:(NSUInteger)motionPoint withInsertionPoint:(NSUInteger)insertionPoint after:(BOOL)after onlyCopy:(BOOL)onlyCopy{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// SourceCodeEditorViewProxy+Scrolling.h
// SourceEditorViewProxy+Scrolling.h
// XVim2
//
// Created by Ant on 02/10/2017.
// Copyright © 2017 Shuichiro Suzuki. All rights reserved.
//

#import "SourceCodeEditorViewProxy.h"
#import "SourceEditorViewProxy.h"
#import <Foundation/Foundation.h>

@interface SourceCodeEditorViewProxy (Scrolling) <SourceViewScrollingProtocol>
@interface SourceEditorViewProxy (Scrolling) <SourceViewScrollingProtocol>
@property (readonly) NSInteger linesPerPage;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

#import "NSTextStorage+VimOperation.h"
#import "SourceViewProtocol.h"
#import "SourceCodeEditorViewProxy+Scrolling.h"
#import "SourceCodeEditorViewProxy+XVim.h"
#import "SourceCodeEditorViewProxy+Yank.h"
#import "SourceEditorViewProxy+Scrolling.h"
#import "SourceEditorViewProxy+XVim.h"
#import "SourceEditorViewProxy+Yank.h"

@interface SourceCodeEditorViewProxy ()
@interface SourceEditorViewProxy ()
@property NSUInteger selectionBegin;
@property NSUInteger insertionPoint;
@property NSUInteger preservedColumn;
Expand All @@ -21,7 +21,7 @@ - (void)xvim_moveCursor:(NSUInteger)pos preserveColumn:(BOOL)preserve;
- (void)xvim_syncStateWithScroll:(BOOL)scroll;
@end

@implementation SourceCodeEditorViewProxy (Scrolling)
@implementation SourceEditorViewProxy (Scrolling)

// This is used by scrollBottom,Top,Center as a common method
- (void)xvim_scrollCommon_moveCursorPos:(NSUInteger)lineNumber firstNonblank:(BOOL)fnb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// Copyright © 2017 Shuichiro Suzuki. All rights reserved.
//

#import "SourceCodeEditorViewProxy.h"
#import "SourceEditorViewProxy.h"
#import "XVimMotionOption.h"
#import <Foundation/Foundation.h>

@interface SourceCodeEditorViewProxy (XVim)
@interface SourceEditorViewProxy (XVim)
- (NSUInteger)xvim_indexOfLineNumber:(NSUInteger)line;
- (NSUInteger)xvim_indexOfLineNumber:(NSUInteger)line column:(NSUInteger)col;
- (NSUInteger)xvim_lineNumberAtIndex:(NSUInteger)idx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
#import <IDEKit/IDEEditorDocument.h>
#import "NSString+VimHelper.h"
#import "NSTextStorage+VimOperation.h"
#import "SourceCodeEditorViewProxy+XVim.h"
#import "SourceCodeEditorViewProxy.h"
#import "SourceCodeEditorViewProxy+Scrolling.h"
#import "SourceEditorViewProxy+XVim.h"
#import "SourceEditorViewProxy.h"
#import "SourceEditorViewProxy+Scrolling.h"
#import "XVim.h"
#import "XVim2-Swift.h"
#import "XVimMotion.h"
#import "XVimOptions.h"
#import "XVimXcode.h"
#import <IDESourceEditor/_TtC15IDESourceEditor19IDESourceEditorView.h>

@interface SourceCodeEditorViewProxy ()
@property (weak) _TtC15IDESourceEditor19IDESourceEditorView* sourceCodeEditorView;
@interface SourceEditorViewProxy ()
@property (weak) _TtC15IDESourceEditor19IDESourceEditorView* sourceEditorView;
@property NSUInteger selectionBegin;
@property XVIM_VISUAL_MODE selectionMode;
@property NSUInteger insertionPoint;
Expand All @@ -36,7 +36,7 @@ - (void)_xvim_killSelection:(XVimSelection)sel;
@end


@implementation SourceCodeEditorViewProxy (XVim)
@implementation SourceEditorViewProxy (XVim)

- (NSUInteger)xvim_indexOfLineNumber:(NSUInteger)line column:(NSUInteger)col
{
Expand Down Expand Up @@ -66,7 +66,7 @@ -(NSRange)xvim_indexRangeForLines:(NSRange)lineRange includeEOL:(BOOL)includeEOL
NSUInteger firstRow = lineRange.location - 1;
NSUInteger numRows = lineRange.length;

NSRange charRange = [self.sourceCodeEditorView characterRangeForLineRange:NSMakeRange(firstRow, numRows)];
NSRange charRange = [self.sourceEditorView characterRangeForLineRange:NSMakeRange(firstRow, numRows)];
if (includeEOL) {
charRange.length += [self.sourceEditorDataSourceWrapper lineTerminatorLengthForLine:(firstRow + numRows - 1)];
}
Expand Down Expand Up @@ -961,25 +961,25 @@ - (void)xvim_escapeFromInsert
- (NSUInteger)xvim_displayNextLine:(NSUInteger)index column:(NSUInteger)column count:(NSUInteger)count option:(MOTION_OPTION)opt
{
for (NSUInteger i = 0; i < count; i++) {
[self.sourceCodeEditorView moveDown:self];
[self.sourceEditorView moveDown:self];
}
// TODO
return [self.sourceCodeEditorView
characterRangeForLineRange:NSMakeRange(self.sourceCodeEditorView
return [self.sourceEditorView
characterRangeForLineRange:NSMakeRange(self.sourceEditorView
.accessibilityInsertionPointLineNumber,
1)]
.location
+ self.sourceCodeEditorView.accessibilityColumnIndexRange.location;
+ self.sourceEditorView.accessibilityColumnIndexRange.location;
}

- (NSUInteger)xvim_displayPrevLine:(NSUInteger)index column:(NSUInteger)column count:(NSUInteger)count option:(MOTION_OPTION)opt
{
for (NSUInteger i = 0; i < count; i++) {
[self.sourceCodeEditorView moveUp:self];
[self.sourceEditorView moveUp:self];
}
NSRange range = self.sourceCodeEditorView.accessibilityColumnIndexRange;
return [self.sourceCodeEditorView
characterRangeForLineRange:NSMakeRange(self.sourceCodeEditorView
NSRange range = self.sourceEditorView.accessibilityColumnIndexRange;
return [self.sourceEditorView
characterRangeForLineRange:NSMakeRange(self.sourceEditorView
.accessibilityInsertionPointLineNumber,
1)]
.location
Expand All @@ -992,9 +992,9 @@ - (void)xvim_registerPositionForUndo:(NSUInteger)pos
{
// XCODE93
/*
__weak SourceCodeEditorViewProxy* weakSelf = self;
__weak SourceEditorViewProxy* weakSelf = self;
[self.undoManager registerUndoWithTarget:self handler:^(id _Nonnull target){
SourceCodeEditorViewProxy* SELF = weakSelf;
SourceEditorViewProxy* SELF = weakSelf;
if (!SELF)
return;
XVimMotion* m = XVIM_MAKE_MOTION(MOTION_POSITION, DEFAULT_MOTION_TYPE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// Copyright © 2017 Shuichiro Suzuki. All rights reserved.
//

#import "SourceCodeEditorViewProxy.h"
#import "SourceEditorViewProxy.h"
#import "XVimMotionType.h"
#import <Foundation/Foundation.h>

@interface SourceCodeEditorViewProxy (Yank) <SourceViewYankProtocol>
@interface SourceEditorViewProxy (Yank) <SourceViewYankProtocol>
- (void)__xvim_startYankWithType:(MOTION_TYPE)type;
- (void)_xvim_yankRange:(NSRange)range withType:(MOTION_TYPE)type;
- (void)_xvim_yankSelection:(XVimSelection)sel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#import "NSString+VimHelper.h"
#import "NSTextStorage+VimOperation.h"
#import "SourceCodeEditorViewProxy+Yank.h"
#import "SourceCodeEditorViewProxy+XVim.h"
#import "SourceCodeEditorViewProxy+Operations.h"
#import "SourceEditorViewProxy+Yank.h"
#import "SourceEditorViewProxy+XVim.h"
#import "SourceEditorViewProxy+Operations.h"
#import "XVimMotion.h"

@interface SourceCodeEditorViewProxy ()
@interface SourceEditorViewProxy ()
@property NSUInteger selectionBegin;
@property NSUInteger insertionPoint;
@property NSUInteger preservedColumn;
Expand All @@ -31,7 +31,7 @@ - (NSRange)xvim_getOperationRangeFrom:(NSUInteger)from To:(NSUInteger)to Type:(M
- (void)_xvim_insertSpaces:(NSUInteger)count replacementRange:(NSRange)replacementRange;
@end

@implementation SourceCodeEditorViewProxy (Yank)
@implementation SourceEditorViewProxy (Yank)

- (NSRange)_xvim_getYankRange:(XVimMotion*)motion withRange:(XVimRange)to
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ static inline XVimSourceEditorRange XvimMakeSourceEditorRange(XVimSourceEditorPo
// SourceEditorSelection is an internal class

@protocol XVimTextViewDelegateProtocol;
@class SourceCodeEditorViewWrapper, SourceEditorDataSourceWrapper;
@class SourceEditorViewWrapper, SourceEditorDataSourceWrapper;

@interface SourceCodeEditorViewProxy : NSObject <SourceViewProtocol>
@interface SourceEditorViewProxy : NSObject <SourceViewProtocol>
@property (readonly) XVIM_VISUAL_MODE selectionMode;
@property (readonly) NSUInteger insertionPoint;
@property (readonly) XVimPosition insertionPosition;
Expand All @@ -89,9 +89,9 @@ static inline XVimSourceEditorRange XvimMakeSourceEditorRange(XVimSourceEditorPo
@property (readonly, nullable) NSWindow* window;
@property (strong, nonnull) NSString* string;
@property BOOL xvim_lockSyncStateFromView;
@property (strong, nullable) SourceCodeEditorViewWrapper* sourceCodeEditorViewWrapper;
@property (strong, nullable) SourceEditorViewWrapper* sourceEditorViewWrapper;
@property (readonly, nonatomic, nullable) SourceEditorDataSourceWrapper* sourceEditorDataSourceWrapper;
- (nullable instancetype)initWithSourceCodeEditorView:(nonnull _TtC15IDESourceEditor19IDESourceEditorView *)sourceEditorView;
- (nullable instancetype)initWithSourceEditorView:(nonnull _TtC15IDESourceEditor19IDESourceEditorView *)sourceEditorView;

// Data source
@property (readonly, nonatomic, nullable) id dataSource;
Expand Down
Loading

0 comments on commit cf20d82

Please sign in to comment.