Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Boop/Boop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/IvanMathy/savannakit";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.14.2;
branch = main;
kind = branch;
};
};
2C8BE186249EBB3D00099B73 /* XCRemoteSwiftPackageReference "fuse-swift" */ = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions DOING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# DOING.md

This document, inspired by [this tweet](https://twitter.com/drwave/status/1564063331341590529), contains the currently in progress or planned features for Boop.

This document was last updated *<u>August, 30th 2022</u>*. Work may be happening in other repositories or branches making this one appear stale, but Boop is still very much an active project.

## In progress

### Multi Cursor Editing

The ability to have more than one active cursor to type and edit content.

### Split Scripts

Separating scripts from the main Boop Github repository, into a dedicated one.

## Planned

### Color Settings

The ability to customize colors beyond light and dark mode. Maybe themes?

### Font Settings

The ability to change font, and more importantly font-size.

## Not Planned

### Load / Save

There is no plan to support files within Boop.

### Tabs

There is no plan to support tabs or multiple windows within Boop.
48 changes: 48 additions & 0 deletions Scripts/CalculateSize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
{
"api": 1,
"name": "Calculate Size (Bytes)",
"description": "Calculates size of text in Bytes",
"author": "zzz",
"icon": "counter",
"tags": "calc,size,bytes,storage"
}
**/

//From https://stackoverflow.com/a/12206089
function getUTF8Length(s) {
var len = 0;
for (var i = 0; i < s.length; i++) {
var code = s.charCodeAt(i);
if (code <= 0x7f) {
len += 1;
} else if (code <= 0x7ff) {
len += 2;
} else if (code >= 0xd800 && code <= 0xdfff) {
// Surrogate pair: These take 4 bytes in UTF-8 and 2 chars in UCS-2
// (Assume next char is the other [valid] half and just skip it)
len += 4; i++;
} else if (code < 0xffff) {
len += 3;
} else {
len += 4;
}
}
return len;
}

function main(input) {
let bytes = getUTF8Length(input.text);
if (bytes > 1000000)
{
bytes /= 1000000;
input.postInfo(`${bytes.toFixed(2)} Mb`)
}
if (bytes > 100000) {
bytes /= 1000;
input.postInfo(`${bytes.toFixed(2)} Kb`)
}
else {
input.postInfo(`${bytes} bytes`)
}
}
28 changes: 28 additions & 0 deletions Scripts/tsvToJson.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
{
"api":1,
"name":"TSV to JSON",
"description":"Converts TSV to JSON",
"author":"Quddus George",
"icon":"table",
"tags":"tab, tsv, json, table"
}
**/

//credit for tsv function: https://gist.github.com/iwek/7154706#gistcomment-3369283

function main(state) {
function tsvJSON(tsv) {
return tsv
.split("\n")
.map((line) => line.split("\t"))
.reduce((a, c, i, d) => {
if (i) {
const item = Object.fromEntries(c.map((val, j) => [d[0][j], val]));
return a ? [...a, item] : [item];
}
}, []);
}
let json = JSON.stringify(tsvJSON(state.fullText));
state.fullText = json;
}