Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
512e090d
Unverified
Commit
512e090d
authored
Jun 15, 2022
by
J-P Nurmi
Committed by
GitHub
Jun 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix confusing typo: extent vs. extend selection (#106002)
parent
a0e333bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
editable.dart
packages/flutter/lib/src/rendering/editable.dart
+8
-8
semantics.dart
packages/flutter/lib/src/semantics/semantics.dart
+8
-8
No files found.
packages/flutter/lib/src/rendering/editable.dart
View file @
512e090d
...
@@ -1482,40 +1482,40 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
...
@@ -1482,40 +1482,40 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
_setSelection
(
selection
,
SelectionChangedCause
.
keyboard
);
_setSelection
(
selection
,
SelectionChangedCause
.
keyboard
);
}
}
void
_handleMoveCursorForwardByCharacter
(
bool
exten
t
Selection
)
{
void
_handleMoveCursorForwardByCharacter
(
bool
exten
d
Selection
)
{
assert
(
selection
!=
null
);
assert
(
selection
!=
null
);
final
int
?
extentOffset
=
_textPainter
.
getOffsetAfter
(
selection
!.
extentOffset
);
final
int
?
extentOffset
=
_textPainter
.
getOffsetAfter
(
selection
!.
extentOffset
);
if
(
extentOffset
==
null
)
{
if
(
extentOffset
==
null
)
{
return
;
return
;
}
}
final
int
baseOffset
=
!
exten
t
Selection
?
extentOffset
:
selection
!.
baseOffset
;
final
int
baseOffset
=
!
exten
d
Selection
?
extentOffset
:
selection
!.
baseOffset
;
_setSelection
(
_setSelection
(
TextSelection
(
baseOffset:
baseOffset
,
extentOffset:
extentOffset
),
TextSelection
(
baseOffset:
baseOffset
,
extentOffset:
extentOffset
),
SelectionChangedCause
.
keyboard
,
SelectionChangedCause
.
keyboard
,
);
);
}
}
void
_handleMoveCursorBackwardByCharacter
(
bool
exten
t
Selection
)
{
void
_handleMoveCursorBackwardByCharacter
(
bool
exten
d
Selection
)
{
assert
(
selection
!=
null
);
assert
(
selection
!=
null
);
final
int
?
extentOffset
=
_textPainter
.
getOffsetBefore
(
selection
!.
extentOffset
);
final
int
?
extentOffset
=
_textPainter
.
getOffsetBefore
(
selection
!.
extentOffset
);
if
(
extentOffset
==
null
)
{
if
(
extentOffset
==
null
)
{
return
;
return
;
}
}
final
int
baseOffset
=
!
exten
t
Selection
?
extentOffset
:
selection
!.
baseOffset
;
final
int
baseOffset
=
!
exten
d
Selection
?
extentOffset
:
selection
!.
baseOffset
;
_setSelection
(
_setSelection
(
TextSelection
(
baseOffset:
baseOffset
,
extentOffset:
extentOffset
),
TextSelection
(
baseOffset:
baseOffset
,
extentOffset:
extentOffset
),
SelectionChangedCause
.
keyboard
,
SelectionChangedCause
.
keyboard
,
);
);
}
}
void
_handleMoveCursorForwardByWord
(
bool
exten
t
Selection
)
{
void
_handleMoveCursorForwardByWord
(
bool
exten
d
Selection
)
{
assert
(
selection
!=
null
);
assert
(
selection
!=
null
);
final
TextRange
currentWord
=
_textPainter
.
getWordBoundary
(
selection
!.
extent
);
final
TextRange
currentWord
=
_textPainter
.
getWordBoundary
(
selection
!.
extent
);
final
TextRange
?
nextWord
=
_getNextWord
(
currentWord
.
end
);
final
TextRange
?
nextWord
=
_getNextWord
(
currentWord
.
end
);
if
(
nextWord
==
null
)
{
if
(
nextWord
==
null
)
{
return
;
return
;
}
}
final
int
baseOffset
=
exten
t
Selection
?
selection
!.
baseOffset
:
nextWord
.
start
;
final
int
baseOffset
=
exten
d
Selection
?
selection
!.
baseOffset
:
nextWord
.
start
;
_setSelection
(
_setSelection
(
TextSelection
(
TextSelection
(
baseOffset:
baseOffset
,
baseOffset:
baseOffset
,
...
@@ -1525,14 +1525,14 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
...
@@ -1525,14 +1525,14 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
);
);
}
}
void
_handleMoveCursorBackwardByWord
(
bool
exten
t
Selection
)
{
void
_handleMoveCursorBackwardByWord
(
bool
exten
d
Selection
)
{
assert
(
selection
!=
null
);
assert
(
selection
!=
null
);
final
TextRange
currentWord
=
_textPainter
.
getWordBoundary
(
selection
!.
extent
);
final
TextRange
currentWord
=
_textPainter
.
getWordBoundary
(
selection
!.
extent
);
final
TextRange
?
previousWord
=
_getPreviousWord
(
currentWord
.
start
-
1
);
final
TextRange
?
previousWord
=
_getPreviousWord
(
currentWord
.
start
-
1
);
if
(
previousWord
==
null
)
{
if
(
previousWord
==
null
)
{
return
;
return
;
}
}
final
int
baseOffset
=
exten
t
Selection
?
selection
!.
baseOffset
:
previousWord
.
start
;
final
int
baseOffset
=
exten
d
Selection
?
selection
!.
baseOffset
:
previousWord
.
start
;
_setSelection
(
_setSelection
(
TextSelection
(
TextSelection
(
baseOffset:
baseOffset
,
baseOffset:
baseOffset
,
...
...
packages/flutter/lib/src/semantics/semantics.dart
View file @
512e090d
...
@@ -3534,8 +3534,8 @@ class SemanticsConfiguration {
...
@@ -3534,8 +3534,8 @@ class SemanticsConfiguration {
set
onMoveCursorForwardByCharacter
(
MoveCursorHandler
?
value
)
{
set
onMoveCursorForwardByCharacter
(
MoveCursorHandler
?
value
)
{
assert
(
value
!=
null
);
assert
(
value
!=
null
);
_addAction
(
SemanticsAction
.
moveCursorForwardByCharacter
,
(
Object
?
args
)
{
_addAction
(
SemanticsAction
.
moveCursorForwardByCharacter
,
(
Object
?
args
)
{
final
bool
exten
t
Selection
=
args
!
as
bool
;
final
bool
exten
d
Selection
=
args
!
as
bool
;
value
!(
exten
t
Selection
);
value
!(
exten
d
Selection
);
});
});
_onMoveCursorForwardByCharacter
=
value
;
_onMoveCursorForwardByCharacter
=
value
;
}
}
...
@@ -3552,8 +3552,8 @@ class SemanticsConfiguration {
...
@@ -3552,8 +3552,8 @@ class SemanticsConfiguration {
set
onMoveCursorBackwardByCharacter
(
MoveCursorHandler
?
value
)
{
set
onMoveCursorBackwardByCharacter
(
MoveCursorHandler
?
value
)
{
assert
(
value
!=
null
);
assert
(
value
!=
null
);
_addAction
(
SemanticsAction
.
moveCursorBackwardByCharacter
,
(
Object
?
args
)
{
_addAction
(
SemanticsAction
.
moveCursorBackwardByCharacter
,
(
Object
?
args
)
{
final
bool
exten
t
Selection
=
args
!
as
bool
;
final
bool
exten
d
Selection
=
args
!
as
bool
;
value
!(
exten
t
Selection
);
value
!(
exten
d
Selection
);
});
});
_onMoveCursorBackwardByCharacter
=
value
;
_onMoveCursorBackwardByCharacter
=
value
;
}
}
...
@@ -3570,8 +3570,8 @@ class SemanticsConfiguration {
...
@@ -3570,8 +3570,8 @@ class SemanticsConfiguration {
set
onMoveCursorForwardByWord
(
MoveCursorHandler
?
value
)
{
set
onMoveCursorForwardByWord
(
MoveCursorHandler
?
value
)
{
assert
(
value
!=
null
);
assert
(
value
!=
null
);
_addAction
(
SemanticsAction
.
moveCursorForwardByWord
,
(
Object
?
args
)
{
_addAction
(
SemanticsAction
.
moveCursorForwardByWord
,
(
Object
?
args
)
{
final
bool
exten
t
Selection
=
args
!
as
bool
;
final
bool
exten
d
Selection
=
args
!
as
bool
;
value
!(
exten
t
Selection
);
value
!(
exten
d
Selection
);
});
});
_onMoveCursorForwardByCharacter
=
value
;
_onMoveCursorForwardByCharacter
=
value
;
}
}
...
@@ -3588,8 +3588,8 @@ class SemanticsConfiguration {
...
@@ -3588,8 +3588,8 @@ class SemanticsConfiguration {
set
onMoveCursorBackwardByWord
(
MoveCursorHandler
?
value
)
{
set
onMoveCursorBackwardByWord
(
MoveCursorHandler
?
value
)
{
assert
(
value
!=
null
);
assert
(
value
!=
null
);
_addAction
(
SemanticsAction
.
moveCursorBackwardByWord
,
(
Object
?
args
)
{
_addAction
(
SemanticsAction
.
moveCursorBackwardByWord
,
(
Object
?
args
)
{
final
bool
exten
t
Selection
=
args
!
as
bool
;
final
bool
exten
d
Selection
=
args
!
as
bool
;
value
!(
exten
t
Selection
);
value
!(
exten
d
Selection
);
});
});
_onMoveCursorBackwardByCharacter
=
value
;
_onMoveCursorBackwardByCharacter
=
value
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment