Commits

Sébastien Ferré committed 8fdde2a

Improved focus intent on object S1s.

Comments (0)

Files changed (2)

     let modifs = GdkEvent.Key.state key in
     if keyval = _Tab then(* && List.mem `CONTROL modifs && not (List.mem `SHIFT modifs) *)
       begin menu_cd (Lisql.focus_next_postfix ~filter:Lisql.focus_default_filter history#current#focus); true end
-    else if keyval = _Right then
+    else if keyval = _Right && List.mem `CONTROL modifs then
       begin menu_cd (Lisql.focus_down history#current#focus); true end
-    else if keyval = _Left then
+    else if keyval = _Left && List.mem `CONTROL modifs then
       begin menu_cd (Lisql.focus_up history#current#focus); true end
-    else if keyval = _Up then
+    else if keyval = _Up && List.mem `CONTROL modifs then
       begin menu_cd (Lisql.focus_left history#current#focus); true end
-    else if keyval = _Down then
+    else if keyval = _Down && List.mem `CONTROL modifs then
       begin menu_cd (Lisql.focus_right history#current#focus); true end
     else false);
 
 
 let focus_of_s a =
   match focus_first_s NilS a with
+  | Some (AtP1 (Thing, Qu1 (Exists, _, Is0 (_,c, NilS)))) -> AtP1 (c, Is1 (Qu (Exists, Thing), c, NilS))
   | Some foc -> foc
   | None -> assert false
 
     and intent_s1 (f : p1 -> intent) : context_s1 -> intent = function
       | Is0 (_,c,k') -> intent_s (f c) k'
       | Role0 (r,_,k') -> intent_p1 (fun c -> f (Role (reverse_p2 r, Qu (Exists, c)))) k'
+      | NAndN (n,l, Role0 (r,_,k')) ->
+	  intent_p1 (fun c -> f (Role (reverse_p2 r, Qu (Exists, And [Role (r, NAnd (Common.list_remove_nth l n)); c])))) k'
       | NAndN (n,l,k') -> intent_s1 f k'
       | NOrN (n,l,k') -> intent_s1 f k'
       | NNot0 (_,k') -> intent_s1 f k'
 	    
     let intent : focus -> intent = function
       | AtP1 (f,k) -> intent_p1 (function Thing -> CExists f | c -> CExists (And [f; c])) k
+      | AtS1 (np, Role0 (r,_,k')) -> intent_p1 (fun c -> CExists (Role (reverse_p2 r, Qu (Exists, And [Role (r,np); c])))) k'
       | AtS1 (np,k) -> intent_s1 (fun c -> CExists c) k
 
     let extent ~obs store (int : intent) : extent =