let get_pattern (v : Ed_sourceview.sourceview) it =
let stop = it in
let start = it#backward_word_start in
let word = v#file#buffer#get_text ~start ~stop () in
let qword = Pcre.quote word in
(* FIXME: use the mode of the buffer to get what is a word *)
(word, Pcre.regexp (Printf.sprintf "%s[^ \t\n\013]+" qword))