Skip to content

Commit

Permalink
feat: Improvement in sora editor
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxGalaxy committed Aug 13, 2023
1 parent 96ed175 commit de5d706
Show file tree
Hide file tree
Showing 47 changed files with 54,470 additions and 2,065 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.7'
implementation 'com.squareup.okhttp3:okhttp:3.9.1'
def editorGroupId = "io.github.Rosemoe.sora-editor"
implementation platform("$editorGroupId:bom:0.21.1")
implementation platform("$editorGroupId:bom:0.22.0")
implementation "$editorGroupId:editor"
implementation "$editorGroupId:language-textmate"
implementation 'jp.co.cyberagent.android:gpuimage:2.1.0'
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/android/code/editor/MyApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
import android.content.Intent;
import android.os.Process;
import android.util.Log;
import android.widget.Toast;
import com.google.android.material.color.DynamicColors;
import editor.tsd.editors.sora.lang.textmate.provider.TextMateProvider;
import io.github.rosemoe.sora.langs.textmate.registry.FileProviderRegistry;
import io.github.rosemoe.sora.langs.textmate.registry.provider.AssetsFileResolver;

public class MyApplication extends Application {
private static Context mApplicationContext;
Expand Down Expand Up @@ -65,5 +69,11 @@ public void uncaughtException(Thread thread, Throwable throwable) {
}
});
super.onCreate();
FileProviderRegistry.getInstance().addFileProvider(new AssetsFileResolver(getAssets()));
try {
TextMateProvider.loadGrammars();
} catch (Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
}
}
}
3 changes: 2 additions & 1 deletion editor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ android {
}

dependencies {
implementation 'com.google.code.gson:gson:2.8.7'
def editorGroupId = "io.github.Rosemoe.sora-editor"
implementation platform("$editorGroupId:bom:0.21.1")
implementation platform("$editorGroupId:bom:0.22.0")
implementation "$editorGroupId:editor"
implementation "$editorGroupId:language-textmate"
implementation "$editorGroupId:language-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"comments": {
"lineComment": "@REM"
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
{ "open": "\"", "close": "\"", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["%", "%"],
["\"", "\""]
],
"folding": {
"markers": {
"start": "^\\s*(::|REM|@REM)\\s*#region",
"end": "^\\s*(::|REM|@REM)\\s*#endregion"
}
}
}
Loading

0 comments on commit de5d706

Please sign in to comment.