Skip to content

Commit

Permalink
DROID-2219 App | Tech | Release 6 stabilisation (#1570)
Browse files Browse the repository at this point in the history
  • Loading branch information
uburoiubu authored Sep 18, 2024
1 parent b118452 commit 197ab2f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,11 @@ open class EditorFragment : NavigationFragment<FragmentEditorBinding>(R.layout.f
isTemplate = command.isTemplate
)
if (!fr.isAdded) {
fr.showChildFragment()
runCatching {
fr.showChildFragment()
}.onFailure {
Timber.e(it, "Error while opening object menu from editor")
}
} else {
Timber.d("Ignoring, fragment already added.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class ObjectMenuFragment : ObjectMenuBaseFragment() {
}

companion object {

fun new(
ctx: Id,
space: Id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ class CodeTextInputWidget : AppCompatEditText, SyntaxHighlighter {
}

private fun setupSyntaxHighlighter() {
addRules(context.obtainSyntaxRules(Syntaxes.KOTLIN))
highlight()
runCatching {
addRules(context.obtainSyntaxRules(Syntaxes.KOTLIN))
highlight()
}.onFailure {
Timber.e(it, "Error while setting up syntax highlighter")
}
super.addTextChangedListener(syntaxTextWatcher)
}

Expand Down Expand Up @@ -129,17 +133,21 @@ class CodeTextInputWidget : AppCompatEditText, SyntaxHighlighter {
}

override fun setupSyntax(lang: String?) {
if (lang == null) {
rules.clear()
clearHighlights()
} else {
val result = context.obtainSyntaxRules(lang)
if (result.isEmpty()) {
addRules(context.obtainGenericSyntaxRules())
runCatching {
if (lang == null) {
rules.clear()
clearHighlights()
} else {
addRules(result)
val result = context.obtainSyntaxRules(lang)
if (result.isEmpty()) {
addRules(context.obtainGenericSyntaxRules())
} else {
addRules(result)
}
highlight()
}
highlight()
}.onFailure {
Timber.e(it, "Error while setting syntax rules.")
}
}

Expand Down

0 comments on commit 197ab2f

Please sign in to comment.