Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e746cfb
Updated for Swift 4
0xWDG Oct 22, 2017
a0d700a
Added zip, rar, tar, gz, 7z, dmg as invalid file-types
0xWDG Oct 22, 2017
01c4bb2
Added gitignore
0xWDG Oct 22, 2017
945fc5c
.gitignore is now working
0xWDG Oct 22, 2017
1258ca8
Removed all Comparing non-optional value of type 'String' warnings
0xWDG Oct 22, 2017
012f877
added automatic build numbering system
0xWDG Oct 22, 2017
854314e
Added 'Upgrading app folder' on new build, to match changes in the '.…
0xWDG Oct 22, 2017
85d8397
Reset build number to '2'
0xWDG Oct 22, 2017
22ed314
Updated for Swift 5
gaetandezeiraud Apr 26, 2019
6d5c464
Merge pull request #1 from Brouilles/master
0xWDG Apr 26, 2019
dc824b1
Code formatting
0xWDG Apr 26, 2019
d99d4ce
Detect Mac OS Mojave appearance
gaetandezeiraud Apr 26, 2019
30f93d2
Get Extension of files and show right icon
gaetandezeiraud Apr 26, 2019
9ebc5da
Improvement
gaetandezeiraud Apr 26, 2019
bb0765a
Update Readme
gaetandezeiraud Apr 27, 2019
3d8a2a9
Merge pull request #2 from wdg/aquaDark_Mojave
0xWDG Apr 27, 2019
bc5fbc7
Merge branch 'master' into fileNode_images
gaetandezeiraud Apr 27, 2019
3724f5e
Merge pull request #3 from wdg/fileNode_images
gaetandezeiraud Apr 27, 2019
8615aba
Rename CodeEditor to Macaw
gaetandezeiraud Apr 27, 2019
55df45b
Add preferences window
gaetandezeiraud Apr 27, 2019
5113c62
Add preferences window
gaetandezeiraud Apr 27, 2019
ecc5c16
reduce the size of images
gaetandezeiraud Apr 29, 2019
dbba7ae
Merge pull request #4 from wdg/preferences_ui
gaetandezeiraud Apr 30, 2019
048b58b
Update php.default.yaml
0xWDG May 8, 2019
4d81696
Update Readme.md
0xWDG May 8, 2019
3701660
Delete ToDo.txt
0xWDG May 8, 2019
e07ec20
Merge pull request #6 from wdg/wdg-patch-1
gaetandezeiraud May 8, 2019
842782a
Add Build Button & Makefile support
gaetandezeiraud May 10, 2019
b8cc498
Update Readme.md
0xWDG May 15, 2019
1129329
Remove NodeJS (npm) build
gaetandezeiraud May 17, 2019
5588efc
Add Alert
gaetandezeiraud May 17, 2019
8592ec6
Merge pull request #7 from wdg/build
0xWDG May 17, 2019
da8c080
Added support for system settings darkmove, fixes #8
0xWDG May 17, 2019
f955750
textview color | Fixed #9
0xWDG May 17, 2019
2345612
Let user choose editor colours | Fixed #10
0xWDG May 17, 2019
2a5efa6
Syntax improvements, settings improvements
0xWDG May 17, 2019
0f9bbfe
Improved build system?
0xWDG May 17, 2019
4c39171
Node building working | see #11
0xWDG May 17, 2019
c887b9c
A test
0xWDG May 17, 2019
8adeb70
Last commit of today
0xWDG May 17, 2019
6f29832
.
0xWDG May 17, 2019
a05536f
Show pdf, png & more with Apple Quickview
gaetandezeiraud May 31, 2019
72cf43d
remove debug
gaetandezeiraud May 31, 2019
390475c
Merge pull request #12 from wdg/quickview
0xWDG Jun 9, 2019
6504437
Add Rust build
gaetandezeiraud Jun 26, 2019
a0b451a
Check if building is possible | fixes #13
0xWDG Oct 25, 2019
68e22d2
Check if building is possible (isEnabled instead of isHidden) | fixes…
0xWDG Oct 25, 2019
8d37109
Update Readme.md
0xWDG Mar 10, 2021
b4a4716
Update Readme.md
0xWDG Mar 10, 2021
334f74b
Split from main fork.
0xWDG Jul 30, 2021
40aeb64
Minor changes
0xWDG Dec 4, 2021
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
77 changes: 77 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/

# CocoaPods - Refactored to standalone file

# Carthage - Refactored to standalone file

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output

### Xcode ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated

## Various settings

## Other

### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
CodeEditor/Assets.xcassets/.DS_Store
.DS_Store

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

90 changes: 72 additions & 18 deletions CodeEditor/AppDelegate.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,67 @@
//

import Cocoa
import NotificationCenter

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

var appFolderName = "MacawEditor"
var appFolderUrl: URL?
var filename: String = ""
var settings = Settings()
var currentBuild = Int(Bundle.main.infoDictionary?["CFBundleVersion"] as! String)!
var preferencesController: NSWindowController?

override init(){
super.init()
print("Hello!")

DistributedNotificationCenter.default.addObserver(
self,
selector: #selector(interfaceColorChanged),
name: .AppleInterfaceThemeChangedNotification,
object: nil
)

setupAppFolder()
settings.load()
Settings.shared.load()
}

@objc func interfaceColorChanged() {
NotificationCenter.default.post(name: .updateTheme, object: nil)
}

func setupAppFolder() {

var forceInstall = false
var installError = false
let filer = FileManager.default

if let libFolder = filer.urls(for: .applicationSupportDirectory, in: .userDomainMask).first {
if let libFolder = filer.urls(
for: .applicationSupportDirectory,
in: .userDomainMask
).first {

appFolderUrl = libFolder.appendingPathComponent(
appFolderName, isDirectory: true
)

appFolderUrl = libFolder.appendingPathComponent(appFolderName, isDirectory: true)
if let lastInstall = UserDefaults.standard.object(forKey: "installed") {
if Int(lastInstall as! Int) < currentBuild {
forceInstall = true
}
}

if !filer.fileExists(atPath: appFolderUrl!.path) {
print("Setting up app folder")
if forceInstall || !filer.fileExists(atPath: appFolderUrl!.path) {
print(forceInstall ? "Upgrading app folder to build \(currentBuild)" : "Setting up app folder")
do {
try filer.createDirectory(at: appFolderUrl!, withIntermediateDirectories: true, attributes: nil)

UserDefaults.standard.set(currentBuild, forKey: "installed")
} catch {
installError = true
print("Error creating app folder and copying syntax files")
Alert("Error creating app folder. Syntax files not loaded. Verify you have permissions to write in folder ~/Library/Application Support/").show()
}

if !installError {
// Copy syntax files to appFolder
let files = [
"Settings.yaml",
Expand All @@ -45,23 +77,35 @@ class AppDelegate: NSObject, NSApplicationDelegate {
"json.default.yaml",
"swift.default.yaml",
"xml.default.yaml",
"php.default.yaml",
"yaml.default.yaml"
]

print("Copying syntax files to app folder")

for item in files {
if filer.fileExists(atPath: (appFolderUrl?.appendingPathComponent(item).path)!) {
do {
try filer.removeItem(at: (appFolderUrl?.appendingPathComponent(item))!)
}
catch {
print("Failed to upgrade \(item)")
Alert("Error accessing app folder. Syntax files not loaded. Verify you have permissions to read from folder ~/Library/Application Support/").show()
}
}

if let source = Bundle.main.url(file: item),
let target = appFolderUrl?.appendingPathComponent(item)
{
//print("Copying file \(source) to \(target)")
try filer.copyItem(at: source, to: target)
do {
try filer.copyItem(at: source, to: target)
}
catch {
print("Failed to upgrade \(item)")
Alert("Error accessing app folder. Syntax files not loaded. Verify you have permissions to read from folder ~/Library/Application Support/").show()
}
}
}

} catch {
print("Error creating app folder and copying syntax files")
Alert("Error creating app folder. Syntax files not loaded. Verify you have permissions to write in folder ~/Library/Application Support/").show()
}
}
} else {
Expand All @@ -77,7 +121,18 @@ class AppDelegate: NSObject, NSApplicationDelegate {
main.fileOpenByOS(filename)
return true
}


@IBAction func showPreferences(_ sender: Any) {
if (preferencesController == nil) {
let storyboard = NSStoryboard(name: NSStoryboard.Name("Preferences"), bundle: nil)
preferencesController = storyboard.instantiateInitialController() as? NSWindowController
}

if (preferencesController != nil) {
preferencesController!.showWindow(sender)
}
}

func applicationDidFinishLaunching(_ notification: Notification) {
//
}
Expand All @@ -87,7 +142,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
print("Goodbye!")
return true
}

Expand Down
Empty file modified CodeEditor/Assets.xcassets/AppIcon.appiconset/Contents.json
100644 → 100755
Empty file.
Binary file modified CodeEditor/Assets.xcassets/AppIcon.appiconset/macaweditor016.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CodeEditor/Assets.xcassets/AppIcon.appiconset/macaweditor032.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CodeEditor/Assets.xcassets/AppIcon.appiconset/macaweditor128.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CodeEditor/Assets.xcassets/AppIcon.appiconset/macaweditor256.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CodeEditor/Assets.xcassets/AppIcon.appiconset/macaweditor512.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified CodeEditor/Assets.xcassets/Contents.json
100644 → 100755
Empty file.
Empty file modified CodeEditor/Assets.xcassets/appicon.imageset/Contents.json
100644 → 100755
Empty file.
Binary file modified CodeEditor/Assets.xcassets/appicon.imageset/appicon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions CodeEditor/Assets.xcassets/icon_dark.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file removed CodeEditor/Assets.xcassets/icon_dark.png
Binary file not shown.
21 changes: 0 additions & 21 deletions CodeEditor/Assets.xcassets/icon_dark2.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file removed CodeEditor/Assets.xcassets/icon_dark2.png
Binary file not shown.
21 changes: 0 additions & 21 deletions CodeEditor/Assets.xcassets/icon_menu.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file removed CodeEditor/Assets.xcassets/icon_menu.png
Binary file not shown.
21 changes: 0 additions & 21 deletions CodeEditor/Assets.xcassets/icon_menu2.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file removed CodeEditor/Assets.xcassets/icon_menu2.png
Binary file not shown.
Empty file modified CodeEditor/Assets.xcassets/icon_new.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified CodeEditor/Assets.xcassets/icon_new.imageset/icon_new.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CodeEditor/Assets.xcassets/icon_new.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified CodeEditor/Assets.xcassets/icon_new2.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified CodeEditor/Assets.xcassets/icon_new2.imageset/icon_new2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CodeEditor/Assets.xcassets/icon_new2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified CodeEditor/Assets.xcassets/icon_open.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified CodeEditor/Assets.xcassets/icon_open.imageset/icon_open.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CodeEditor/Assets.xcassets/icon_open.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified CodeEditor/Assets.xcassets/icon_open2.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified CodeEditor/Assets.xcassets/icon_open2.imageset/icon_open2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CodeEditor/Assets.xcassets/icon_open2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions CodeEditor/Assets.xcassets/icon_options.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file removed CodeEditor/Assets.xcassets/icon_options.png
Binary file not shown.
Loading