Store selection base/extent as integers (#21663)
Previously, the selection base and extent were stored internally as iterators over text_. Since iterators must be treated as invalidated whenever the underlying container changes, this requires that selection_base_ and selection_extent_ be re-assigned after every change to text_. This is not currently particularly problematic, but once we add fields to track the base and extent of the composing region for multi-step input method support, as well as support for the sub-range within the composing region to which edits/completions apply, we end up having to regenerate a lot of iterators with each change, many of which are logically unchanged in position. A side benefit is that this simplifies inspection of these fields when debugging.
Showing
想要评论请 注册 或 登录