Skip to content

Commit

Permalink
Rename variable in getEmbedNode function
Browse files Browse the repository at this point in the history
  • Loading branch information
singerdmx committed Jul 22, 2022
1 parent a1508d0 commit 6a462ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/utils/embeds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import '../widgets/controller.dart';

Tuple2<int, Embed> getEmbedNode(QuillController controller, int offset) {
var offset = controller.selection.start;
var imageNode = controller.queryNode(offset);
if (imageNode == null || !(imageNode is Embed)) {
var embedNode = controller.queryNode(offset);
if (embedNode == null || !(embedNode is Embed)) {
offset = max(0, offset - 1);
imageNode = controller.queryNode(offset);
embedNode = controller.queryNode(offset);
}
if (imageNode != null && imageNode is Embed) {
return Tuple2(offset, imageNode);
if (embedNode != null && embedNode is Embed) {
return Tuple2(offset, embedNode);
}

return throw 'Embed node not found by offset $offset';
Expand Down

0 comments on commit 6a462ee

Please sign in to comment.