Skip to content

Commit

Permalink
Update version, changelog, shell script highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
billthefarmer committed Apr 5, 2022
1 parent 1d98211 commit e73c14f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
applicationId "org.billthefarmer.editor"
minSdkVersion 14
targetSdkVersion 28
versionName "1.72"
versionCode 172
versionName "1.73"
versionCode 173

buildConfigField "long", "BUILT", System.currentTimeMillis() + "L"
}
Expand Down
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-GB/changelogs/173.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Add Emacs Org syntax highlighting
* Update shell script syntax highlighting
36 changes: 36 additions & 0 deletions src/main/java/org/billthefarmer/editor/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ public class Editor extends Activity
public final static Pattern MD_CODE = Pattern.compile
("(^ {4,}.+$)|(`.+?`)", Pattern.MULTILINE);

public final static Pattern SH_VAR = Pattern.compile
("(\\$\\b\\w+\\b)|(\\$\\{.+?\\})|(\\$\\(.+?\\))", Pattern.MULTILINE);

public final static Pattern SH_COMMENT = Pattern.compile
("#.*$", Pattern.MULTILINE);

Expand Down Expand Up @@ -2671,6 +2674,39 @@ private void highlightText()
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}

matcher.region(start, end).usePattern(SH_VAR);
while (matcher.find())
{
ForegroundColorSpan span = new
ForegroundColorSpan(Color.MAGENTA);

// Highlight it
editable.setSpan(span, matcher.start(), matcher.end(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}

matcher.region(start, end).usePattern(OPERATOR);
while (matcher.find())
{
ForegroundColorSpan span = new
ForegroundColorSpan(Color.CYAN);

// Highlight it
editable.setSpan(span, matcher.start(), matcher.end(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}

matcher.region(start, end).usePattern(QUOTED);
while (matcher.find())
{
ForegroundColorSpan span = new
ForegroundColorSpan(Color.RED);

// Highlight it
editable.setSpan(span, matcher.start(), matcher.end(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}

matcher.region(start, end).usePattern(SH_COMMENT);
while (matcher.find())
{
Expand Down

6 comments on commit e73c14f

@D19A66B55
Copy link

Choose a reason for hiding this comment

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

Thank you for your time & efforts on "Editor".
I only have 1 important request:
Please put .apk link on your releases page.
It takes 2-3 days to appear on F-Droid.
I don't understand why you don't have a release .apk for your users.
I can't be the only person whose asked for this.
"Editor" is nowhere else to be found, that I've researched, except at F-droid.
Thank you.

@billthefarmer
Copy link
Owner Author

Choose a reason for hiding this comment

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

I used to put an apk inreleases once F-Droid have built it. I've stopped doing it lately because I've been too busy to keep track.

@D19A66B55
Copy link

@D19A66B55 D19A66B55 commented on e73c14f Apr 9, 2022 via email

Choose a reason for hiding this comment

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

@D19A66B55
Copy link

@D19A66B55 D19A66B55 commented on e73c14f Apr 12, 2022 via email

Choose a reason for hiding this comment

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

@D19A66B55
Copy link

@D19A66B55 D19A66B55 commented on e73c14f Oct 11, 2022 via email

Choose a reason for hiding this comment

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

@billthefarmer
Copy link
Owner Author

Choose a reason for hiding this comment

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

There's an important point here that I think people are missing. If I post my own signed version of an app on GitHub, then it can't be updated via F-Droid without uninstalling and reinstalling because of licence mismatch. So I wait for them to build and sign it before adding the .apk here, when I get around to it. Once they've built it, it usually appears in the app and online fairly quickly, so there's not much to be gained by downloading from here unless you don't want to use F-Froid. At least some of my apps are on Fossdroid, https://fossdroid.com/a/editor.html, but they must get them from F-Droid.

Please sign in to comment.