remove some unnecessary regex escapes
This commit is contained in:
parent
cda72a1174
commit
12084a3421
|
@ -211,7 +211,7 @@ class _ToolbarBody extends HookWidget {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final line = controller.firstSelectedLine;
|
final line = controller.firstSelectedLine;
|
||||||
|
|
||||||
if (line.startsWith(RegExp.escape('* '))) {
|
if (line.startsWith('* ')) {
|
||||||
controller.removeAtBeginningOfEverySelectedLine('* ');
|
controller.removeAtBeginningOfEverySelectedLine('* ');
|
||||||
} else if (line.startsWith('- ')) {
|
} else if (line.startsWith('- ')) {
|
||||||
controller.removeAtBeginningOfEverySelectedLine('- ');
|
controller.removeAtBeginningOfEverySelectedLine('- ');
|
||||||
|
@ -399,7 +399,7 @@ extension on TextEditingController {
|
||||||
var linesCount = 0;
|
var linesCount = 0;
|
||||||
while (lines.moveNext()) {
|
while (lines.moveNext()) {
|
||||||
if (lines.isWithinSelection) {
|
if (lines.isWithinSelection) {
|
||||||
if (lines.current.startsWith(RegExp.escape(s))) {
|
if (lines.current.startsWith(s)) {
|
||||||
lines.current = lines.current.substring(s.length);
|
lines.current = lines.current.substring(s.length);
|
||||||
linesCount++;
|
linesCount++;
|
||||||
}
|
}
|
||||||
|
@ -420,7 +420,7 @@ extension on TextEditingController {
|
||||||
var linesCount = 0;
|
var linesCount = 0;
|
||||||
while (lines.moveNext()) {
|
while (lines.moveNext()) {
|
||||||
if (lines.isWithinSelection) {
|
if (lines.isWithinSelection) {
|
||||||
if (!lines.current.startsWith(RegExp.escape(s))) {
|
if (!lines.current.startsWith(s)) {
|
||||||
lines.current = '$s${lines.current}';
|
lines.current = '$s${lines.current}';
|
||||||
linesCount++;
|
linesCount++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue