automatic text case improvement: lowercase is now enforced, when the cursor is next to or in the middle of a word (#272)
This commit is contained in:
parent
de964e8b0f
commit
4aa11b9501
1 changed files with 5 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import io.github.sspanak.tt9.languages.Language;
|
|||
import io.github.sspanak.tt9.preferences.SettingsStore;
|
||||
|
||||
public class AutoTextCase {
|
||||
private final Pattern nextToWordRegex = Pattern.compile("\\b$");
|
||||
private final Pattern startOfSentenceRegex = Pattern.compile("(?<!\\.)(^|[.?!¿¡])\\s*$");
|
||||
private final SettingsStore settings;
|
||||
|
||||
|
|
@ -71,6 +72,10 @@ public class AutoTextCase {
|
|||
return InputMode.CASE_CAPITALIZE;
|
||||
}
|
||||
|
||||
if (nextToWordRegex.matcher(textBeforeCursor).find()) {
|
||||
return InputMode.CASE_LOWER;
|
||||
}
|
||||
|
||||
return InputMode.CASE_DICTIONARY;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue