Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #400 from AndreyKozhev/text_symbols
Browse files Browse the repository at this point in the history
Add Symbols for text and other files (fix the problem when SymbolInputView does not display anything)
  • Loading branch information
itsaky authored Aug 22, 2022
2 parents ce29468 + 659ffa7 commit 160de23
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions app/src/main/java/com/itsaky/androidide/utils/Symbols.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public static Symbol[] forFile(@Nullable File file) {
if (file.getName().endsWith(".java")
|| file.getName().endsWith(".gradle")
|| file.getName().endsWith(".kt")) return javaSymbols();

if (file.getName().endsWith(".xml")) return xmlSymbols();
else if (file.getName().endsWith(".xml")) return xmlSymbols();
else return plainTextSymbols();
}

return new Symbol[0];
Expand Down Expand Up @@ -99,6 +99,33 @@ public static Symbol[] xmlSymbols() {
};
}

public static Symbol[] plainTextSymbols() {
return new Symbol[] {
new Symbol("↹", "\t"),
new Symbol("{", "{}"),
new Symbol("}"),
new Symbol("(", "()"),
new Symbol(")"),
new Symbol("="),
new Symbol("\"", "\"\""),
new Symbol("'", "''"),
new Symbol("|"),
new Symbol("&"),
new Symbol("!"),
new Symbol("[", "[]"),
new Symbol("]"),
new Symbol("<", "<>"),
new Symbol(">"),
new Symbol("+"),
new Symbol("-"),
new Symbol("/"),
new Symbol("~"),
new Symbol("`"),
new Symbol(":"),
new Symbol("_")
};
}

public static String createTabSpaces() {
int size = EditorPreferencesKt.getTabSize();
StringBuilder tab = new StringBuilder();
Expand Down

0 comments on commit 160de23

Please sign in to comment.