Skip to content

Commit

Permalink
Fix index out of bound on range selection (#49)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #49

Reviewed By: fantactuka

Differential Revision: D51397817

Pulled By: amyworrall

fbshipit-source-id: b68b41c334097cd0ae211eefa3f7fe44f4b34023
  • Loading branch information
mansimransingh authored and facebook-github-bot committed Nov 17, 2023
1 parent 4a85d22 commit f9b84c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lexical/Core/Selection/RangeSelection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ public class RangeSelection: BaseSelection {
if startOffset != 0 {
// the entire first node isn't selected, so split it
let splitNodes = try textNode.splitText(splitOffsets: [startOffset])
if splitNodes.count >= 1 {
if splitNodes.count > 1 {
textNode = splitNodes[1]
}

Expand Down

0 comments on commit f9b84c4

Please sign in to comment.