Skip to content

RikuKunMS2/CotEditor

 
 

Repository files navigation

What this particular fork does

It makes it so cot editor stops asking you to save untitled files and just quits. Unfortunately it quits on tab close on the final window, didn't figure out how to fix that yet, so instead I'm using better touch tool to handle the hot closing:

I setup better touch tool to do this:

Set up Leftclick Red Window Button trigger with an advanced condition focused_element_details BEGINSWITH "<AXApplication: \"CotEditor\">" AND (NOT (focused_element_details CONTAINS " <AXWindow: \"Find & Replace\">")) then have it run a shell script:

window_count=$(osascript -e 'tell application "System Events" to count (every window of application process "CotEditor")')

if [[ "$window_count" -eq "1" ]]; then
  # Close the active window (more robust than quitting the app if only one window exists)
  osascript -e 'quit application "CotEditor"'
  echo "Active CotEditor quit."
elif [[ "$window_count" -gt "0" ]]; then
  echo "Multiple CotEditor windows are open ($window_count).  Closing now"
  osascript -e 'tell application "CotEditor" to close (window 1)'
else
  echo "No CotEditor windows are open."
fi

CotEditor

CotEditor is a lightweight plain-text editor for macOS. The project aims to provide a general plain-text editor for everyone with an intuitive macOS-native user interface.

screenshot

Source Code

CotEditor is a purely macOS native application written in Swift. It adopts Cocoa's document-based application architecture and respects the power of NSTextView.

Development Environment

  • macOS 15 Sequoia
  • Xcode 16
  • Swift 6 (partly in Swift 5 mode)
  • Sandbox and hardened runtime enabled

Contribution

CotEditor has its own contributing guidelines. Read CONTRIBUTING.md through before you create an issue or make a pull request.

How to Build

Build for Ad-hoc usage

For those people who just want to build and play with CotEditor locally.

  1. Open CotEditor.xcodeproj in Xcode.
  2. Change to ad-hoc build mode:
    1. Open Configurations/CodeSigning.xcconfig.
    2. Comment out #include "CodeSigning-Default.xcconfig".
    3. Uncomment #include "CodeSigning-AdHoc.xcconfig".
  3. Build “CotEditor” scheme.

Build for distribution

  1. Open CotEditor.xcodeproj in Xcode.
  2. Build “CotEditor” scheme.

License

© 2005-2009 nakamuxu, © 2011, 2014 usami-k, © 2013-2024 1024jp.

The source code is licensed under the terms of the Apache License, Version 2.0. The image resources are licensed under the terms of the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. See LICENSE for details.

About

Lightweight Plain-Text Editor for macOS

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 64.4%
  • HTML 34.9%
  • Other 0.7%