Lines 233-241
bool GetSurroundingText(FcitxInstance* instance,
Link Here
|
233 |
|
233 |
|
234 |
const size_t selection_start = std::min(cursor_pos, anchor_pos); |
234 |
const size_t selection_start = std::min(cursor_pos, anchor_pos); |
235 |
const size_t selection_length = std::abs(info->relative_selected_length); |
235 |
const size_t selection_length = std::abs(info->relative_selected_length); |
236 |
info->preceding_text = Util::Utf8SubString(surrounding_text, 0, selection_start); |
236 |
info->preceding_text = std::string(Util::Utf8SubString(surrounding_text, 0, selection_start)); |
237 |
info->selection_text = Util::Utf8SubString(surrounding_text, selection_start, selection_length); |
237 |
info->selection_text = std::string(Util::Utf8SubString(surrounding_text, selection_start, selection_length)); |
238 |
info->following_text = Util::Utf8SubString(surrounding_text, selection_start + selection_length); |
238 |
info->following_text = std::string(Util::Utf8SubString(surrounding_text, selection_start + selection_length)); |
239 |
return true; |
239 |
return true; |
240 |
} |
240 |
} |