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

Basic open/save functionality #331

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

nobecutan
Copy link

With this merge request I propose basic file handling functionality. Open any file type and try to parse it as String via String(contentsOf: pathUrl) – silently ignore the file if it cannot be parsed. This works also via CMD+O and by dragging the file on the app icon.
This addresses #256 and #227.

Save the content as file (via CMD+S). There is no notion of an open file, it's always "Save As…".
This addresses #278.

@sonarcloud
Copy link

sonarcloud bot commented Apr 22, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

do {
try textData?.write(to: pathUrl)
} catch let error as NSError {
setText("Failed to save content to file '\(pathUrl.path)'. (Reason: \(error.localizedFailureReason!))")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad move ;)

it replaces my "important" text and its deleted :/

tinyg added a commit to tinyg/Boop that referenced this pull request Jul 23, 2023
Port nobecutan's changes to the latest version of Boop and then make the errors show in the status view.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants