Skip to content

Commit 82a54a6

Browse files
committed
Fix FindWord returning tuple of int32,int32
1 parent 936661d commit 82a54a6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bindings/interface/TextView.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,13 @@ py::class_<BTextView, PyBTextView, BView, std::unique_ptr<BTextView,py::nodelete
268268
},"",py::arg("offset"))
269269
.def("OffsetAt", py::overload_cast<BPoint>(&BTextView::OffsetAt,py::const_), "", py::arg("point"))
270270
.def("OffsetAt", py::overload_cast<int32>(&BTextView::OffsetAt,py::const_), "", py::arg("line"))
271-
.def("FindWord", &BTextView::FindWord, "", py::arg("offset"), py::arg("_fromOffset"), py::arg("_toOffset"))
271+
//.def("FindWord", &BTextView::FindWord, "", py::arg("offset"), py::arg("_fromOffset"), py::arg("_toOffset"))
272+
.def("FindWord", [](BTextView& self, int32 offset) -> std::tuple<int32,int32>{
273+
int32 _fromOffset;
274+
int32 _toOffset;
275+
self.FindWord(offset,&_fromOffset,&_toOffset);
276+
return std::make_tuple(_fromOffset,_toOffset);
277+
},"", py::arg("offset"))
272278
.def("CanEndLine", &BTextView::CanEndLine, "", py::arg("offset"))
273279
.def("LineWidth", &BTextView::LineWidth, "", py::arg("lineNumber")=0)
274280
.def("LineHeight", &BTextView::LineHeight, "", py::arg("lineNumber")=0)

0 commit comments

Comments
 (0)