diff options
author | ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-05-08 08:41:16 +0000 |
---|---|---|
committer | ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-05-08 08:41:16 +0000 |
commit | 945d7db9fc742b3144754bcf227a669b37bbcb47 (patch) | |
tree | b3d83d25e4b09e15ab3b681a175eecfa8d17b4b3 /ide/gtk_parsing.ml | |
parent | 349c6ecc1d2a63bc7b45fda3093890a3565a80d1 (diff) |
Rewritten the autocompletion mechanism of CoqIDE, and stuffed it
into the ScriptView widget. The autocompletion algorithm may be a
bit too greedy, so there are tests to do on huge buffers to check
whether it is too slow and therefore we should fine-tune it.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15282 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'ide/gtk_parsing.ml')
-rw-r--r-- | ide/gtk_parsing.ml | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ide/gtk_parsing.ml b/ide/gtk_parsing.ml index c69f92e2d..590a3493f 100644 --- a/ide/gtk_parsing.ml +++ b/ide/gtk_parsing.ml @@ -6,6 +6,7 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) +open Ideutils let underscore = Glib.Utf8.to_unichar "_" ~pos:(ref 0) let arobase = Glib.Utf8.to_unichar "@" ~pos:(ref 0) @@ -21,14 +22,12 @@ let is_word_char c = let starts_word (it:GText.iter) = - prerr_endline ("Starts word ? '"^(Glib.Utf8.from_unichar it#char)^"'"); - (not it#copy#nocopy#backward_char || - (let c = it#backward_char#char in - not (is_word_char c))) - + (it#is_start || + (let c = it#backward_char#char in + not (is_word_char c))) let ends_word (it:GText.iter) = - (not it#copy#nocopy#forward_char || + (it#is_end || let c = it#forward_char#char in not (is_word_char c) ) @@ -56,7 +55,6 @@ let find_word_start (it:GText.iter) = in step_to_start it#copy - let find_word_end (it:GText.iter) = let rec step_to_end (it:GText.iter) = prerr_endline "Find word end"; |