Skip to content

Commit

Permalink
#363 Context based formatting
Browse files Browse the repository at this point in the history
- place cursor at the end of the selection after markdown has been added
  • Loading branch information
stefan-niedermann committed Feb 7, 2019
1 parent 1b882b4 commit d5cfb38
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
this.addMarkdown(ssb, start, end, markdown, Typeface.BOLD);
}
editText.setText(ssb);
editText.setSelection(end + markdown.length() * 2);
break;
case R.id.italic:
markdown = "*";
Expand All @@ -76,6 +77,7 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
this.addMarkdown(ssb, start, end, markdown, Typeface.ITALIC);
}
editText.setText(ssb);
editText.setSelection(end + markdown.length() * 2);
break;
case R.id.link:
ssb.insert(end, "]()");
Expand Down

0 comments on commit d5cfb38

Please sign in to comment.