mirror of https://github.com/M66B/FairEmail.git
Insert space before snippets
This commit is contained in:
parent
e99633b742
commit
eac24e3861
|
@ -235,7 +235,17 @@ public class EditTextCompose extends FixedEditText {
|
||||||
int start = getSelectionStart();
|
int start = getSelectionStart();
|
||||||
if (start < 0)
|
if (start < 0)
|
||||||
start = 0;
|
start = 0;
|
||||||
getText().insert(start, ssb);
|
|
||||||
|
Editable edit = getText();
|
||||||
|
|
||||||
|
if (start > 0) {
|
||||||
|
char kar = edit.charAt(start - 1);
|
||||||
|
if (!(kar == '\n' || kar == ' '))
|
||||||
|
edit.insert(start++, " ");
|
||||||
|
}
|
||||||
|
|
||||||
|
edit.insert(start, ssb);
|
||||||
|
|
||||||
setSelection(start + ssb.length());
|
setSelection(start + ssb.length());
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
|
|
Loading…
Reference in New Issue