Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 12 macOS 11 Big Sur Compatibility #1

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
91de9de
Updated readme
kaunteya Oct 23, 2017
49492b4
Updated README
kaunteya Oct 23, 2017
96ed109
Updated readme
kaunteya Oct 26, 2017
a7568d3
Updated for Swift 4
kaunteya Jan 6, 2018
d77f9a0
Duplicate Lines -> Copy lines
kaunteya Jan 6, 2018
26162e2
Merge remote-tracking branch 'origin/master'
kaunteya Jan 6, 2018
0a77020
Updated readme for copy lines
kaunteya Jan 6, 2018
bf6e2c1
Updated readme
kaunteya Jan 25, 2018
28ce8a3
Line selection first selects line without indentation-whitespace
Apr 19, 2018
c33820e
Version update
Apr 19, 2018
2f4001e
Updated readme
kaunteya Apr 20, 2018
b2297f2
Added .DS_Store to gitignore
Apr 29, 2018
2266f06
Updated alignment
Apr 29, 2018
e5fd316
Updated expand
May 4, 2018
22c1c60
Merge branch 'master' of https://github.com/kaunteya/LineX
May 4, 2018
4bbd85b
Update none selection
May 4, 2018
de6feeb
Merge branch 'master' into development
May 4, 2018
4c192c1
Fixes
May 5, 2018
a5832b2
Minor changes
May 5, 2018
1e64bd1
Changes
May 5, 2018
0b675af
Changes
May 5, 2018
b75b1ed
Refactoring
May 5, 2018
e850432
Changes
May 5, 2018
7170221
Changes
May 5, 2018
010edd5
Removed images
May 5, 2018
7c0f6a9
Updated folders
May 5, 2018
5a87fe1
Updates
May 5, 2018
8cf0f85
.
May 5, 2018
401dc6f
.
May 5, 2018
5ee6193
..
May 5, 2018
2e2481b
Minor changes
May 16, 2018
f475c2a
Changes
May 17, 2018
5c7482f
Changes
May 18, 2018
4fc89ff
Changes
May 18, 2018
407d397
Cahnges
May 18, 2018
97d08d3
Changes
May 19, 2018
e8ede68
Changes
May 22, 2018
81c2433
Bug fixes
May 24, 2018
3dcd715
Structure change
May 24, 2018
158885e
update selection
May 24, 2018
740a2cc
Structure change
May 24, 2018
199c4cc
Updates
May 24, 2018
272b11e
Fixed the bug of string replacement
Jun 16, 2018
e677b3a
Initial of multiple cursors
Jun 18, 2018
777a4f3
Updated expand
Jun 18, 2018
b123015
align
Jun 18, 2018
6ae0e98
.
Jun 18, 2018
6a48370
Updated line commands
Jun 18, 2018
44e70da
Added line join
Jun 18, 2018
53526af
Changes
Jun 19, 2018
48e440f
Cleanup
Jun 19, 2018
da56f3c
Minor changes
Jul 14, 2018
05e00df
Version update
Jul 14, 2018
c86a287
Version update
Jul 14, 2018
b7e9374
Upgrade to Swift 5
toastersocks Nov 25, 2020
5148a81
Make compatible with Xcode 12 on macOS 11 Big Sur
toastersocks Nov 25, 2020
8fda19b
Fix warnings about the XcodeKit framework being built for a newer ver…
toastersocks Nov 25, 2020
7e1306e
Update to recommended settings.
toastersocks Nov 25, 2020
a3f2a83
Fix warning about immediate execution of defer statement.
toastersocks Nov 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
Expand Down
156 changes: 0 additions & 156 deletions Common.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Convert/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
Expand Down
38 changes: 27 additions & 11 deletions Convert/SourceEditorCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,47 @@ class SourceEditorCommand: NSObject, XCSourceEditorCommand {
func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void ) -> Void {

let buffer = invocation.buffer
let selectedRanges: SelectionType = selectionRanges(of: buffer)

if let command = Options(command: invocation.commandIdentifier) {
let command = Options(command: invocation.commandIdentifier)!
buffer.selectionRanges.forEach { range in
switch range.selection {

switch selectedRanges {
case .none(let line, let column):
let range = buffer.selections.firstObject as! XCSourceTextRange
var currentLine = buffer.lines[line] as! String
let currentChar = currentLine[column] as String
let currentLine = buffer[line]
let currentChar = currentLine[column]
if currentChar.presentIn(.decimalDigits), var num = Int(String(currentChar)) {
switch command {
case .increment: num += 1
case .decrement: num -= 1//currentLine.replaceSubrange(currentRange, with: "\(num - 1)")
}
}

default: break
}
}

/*
switch selection {
case .none(let position):
var currentLine = buffer.lines[position.line] as! String
let currentChar = currentLine[position.column]

//If caret is beside number
if let _ = currentChar.rangeOfCharacter(from: .decimalDigits), let num = Int(currentChar) {
if currentChar.presentIn(.decimalDigits), let num = Int(String(currentChar)) {
let currentRange = currentLine.indexRangeFor(range: range.start.column...range.start.column)
switch command {
case .increment: currentLine.replaceSubrange(currentRange, with: "\(num + 1)")
case .decrement: currentLine.replaceSubrange(currentRange, with: "\(num - 1)")
}
} else {
if let selectionRange:Range<String.Index> = currentLine.selectWord(pin: column) {
if let selectionRange:Range<String.Index> = currentLine.selectWord(pin: position.column, validChars: .validWordChars) {
let selectedSubString = currentLine[selectionRange]
if let newString = toggle(boolString: selectedSubString) {
currentLine.replaceSubrange(selectionRange, with: newString)
}
}
}
buffer.lines.replaceObject(at: line, with: currentLine)
buffer.lines.replaceObject(at: position.line, with: currentLine)

case .words(let line, let colStart, let colEnd):
var currentLine = buffer.lines[line] as! String
Expand Down Expand Up @@ -76,9 +91,10 @@ class SourceEditorCommand: NSObject, XCSourceEditorCommand {
}

case .lines(_, _): break
case .multiLocation(_): break
}
}
*/

// }

completionHandler(nil)
}
Expand Down
26 changes: 0 additions & 26 deletions Line/Extras.swift

This file was deleted.

Loading