backward_visible_word_start/forward_visible_word_end not work as expected, stop on underline
With vala use the following function:
SourceLanguageManager manager = SourceLanguageManager.get_default();
SourceLanguage lang = manager.get_language("vala");
SourceBuffer buffer = new SourceBuffer.with_language(lang);
With doubleclick on the "o" the whole word is selected "get_word_at_iter" OK!
With my funtion it return only "word" because ...word_start/...word_end stops at underline. BUG?!
public static string? get_word_at_iter(Gtk.SourceBuffer buffer, ref TextIter iter)
{
var startIter = iter;
var endIter = iter;
if (startIter.backward_visible_word_start())
{
if (endIter.forward_visible_word_end())
{
return buffer.get_text(startIter, endIter, false);
}
}
return null;
}
Edited by Ghost User