Get current editable `TreeItem` text range value

Godot Version

4.3

Question

I have a Tree with a number of editable TreeItem. Here’s how I set up the editable column (simplified to highlight my question):

var t: Tree = Tree.new()
var root: TreeItem = t.create_item()
...
var t: TreeItem = t.create_item(root)
...
t.set_cell_mode(1, TreeItem.CELL_MODE_RANGE)
t.set_text(1, "android,ios,pc")
t.set_editable(1, true)

In this script, I’ve set the cell mode to be a range with three string options, android,ios,pc. This works great and I receive the item_edited signal whenever this value is changed.

How do I tell what the selected text range value is?

I see there is a get_range function, but this returns a float. If I use get_text, it returns "android,ios,pc" instead of only the currently selected range option.

Thanks!

Even though ed.get_range(1) returns a float, this is actually the index of the selected item when in CELL_MODE_RANGE.