Skip to content

Commit

Permalink
Reformat code, optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Feb 20, 2022
1 parent 0b48c2a commit d9c78be
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
Expand Down Expand Up @@ -257,7 +256,7 @@ public void showTextEditor(final Document document, final boolean preview, final

final boolean sameDocumentRequested = (
currentFragment instanceof DocumentEditFragment &&
document.getPath().equals(((DocumentEditFragment) currentFragment).getDocument().getPath()));
document.getPath().equals(((DocumentEditFragment) currentFragment).getDocument().getPath()));

if (!sameDocumentRequested) {
showFragment(DocumentEditFragment.newInstance(document, fileLineNumber).setPreviewFlag(preview));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import android.os.Bundle;
import android.support.annotation.Nullable;

import net.gsantner.markor.model.Document;

public class OpenShareIntoActivity extends OpenEditorActivity {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
package net.gsantner.markor.format;

import android.annotation.SuppressLint;
import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.Spanned;

import net.gsantner.opoc.util.StringUtils;

import java.util.EmptyStackException;
import java.util.List;
import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -260,7 +258,7 @@ private static OrderedListLine getOrderedListStart(final Editable text, int posi
/**
* This function will first walk up to the top of the current list
* and then walk down to the end, renumbering ordered list items along the way
*
* <p>
* This is an unfortunately complex + complicated function. Tweak at your peril and test a *lot* :)
*/
public static void renumberOrderedList(final Editable text, int cursorPosition, final PrefixPatterns prefixPatterns) {
Expand All @@ -280,7 +278,7 @@ public static void renumberOrderedList(final Editable text, int cursorPosition,

try {
// Loop to end of list
while(firstLine.isParentLevelOf(line) || firstLine.isMatchingList(line)) {
while (firstLine.isParentLevelOf(line) || firstLine.isMatchingList(line)) {

if (line.isOrderedList) {
// Indented. Add level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import android.content.Context;
import android.graphics.Typeface;
import android.text.InputFilter;
import android.text.Spannable;

import net.gsantner.markor.format.markdown.MarkdownHighlighterPattern;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

import net.gsantner.markor.format.AutoFormatter;

import java.util.regex.Pattern;

public class MarkdownAutoFormat implements InputFilter {

private final AutoFormatter _autoFormatter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@

import android.content.Context;
import android.graphics.Typeface;
import android.text.InputFilter;
import android.text.Spannable;

import net.gsantner.markor.format.ListHandler;
import net.gsantner.markor.model.Document;
import net.gsantner.markor.ui.hleditor.Highlighter;
import net.gsantner.markor.ui.hleditor.HighlightingEditor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package net.gsantner.markor.format.plaintext;

import android.content.Context;
import android.text.InputFilter;
import android.text.Spannable;

import net.gsantner.markor.model.Document;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import android.content.Context;
import android.graphics.Typeface;
import android.text.InputFilter;
import android.text.Spannable;
import android.util.Patterns;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@

import android.content.Context;
import android.graphics.Typeface;
import android.text.InputFilter;
import android.text.Spannable;

import net.gsantner.markor.format.ListHandler;
import net.gsantner.markor.model.Document;
import net.gsantner.markor.ui.hleditor.Highlighter;
import net.gsantner.markor.ui.hleditor.HighlightingEditor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import android.graphics.Typeface;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.text.InputFilter;
import android.text.ParcelableSpan;
import android.text.Spannable;
import android.text.TextWatcher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ public final void runRenumberOrderedListIfRequired(final boolean force) {
try {
_hlEditor.setAccessibilityEnabled(false);
_hlEditor.withAutoFormatDisabled(() -> renumberOrderedList(StringUtils.getSelection(_hlEditor)[0]));
} finally{
} finally {
if (isAccessibilityEnabled) {
_hlEditor.setAccessibilityEnabled(true);
}
Expand Down

0 comments on commit d9c78be

Please sign in to comment.