texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Patches: copy/paste and selection handling.


From: Philippe Joyez
Subject: Re: [Texmacs-dev] Patches: copy/paste and selection handling.
Date: Sat, 5 Dec 2009 04:15:16 -0800 (PST)

Dear Norbert,

  
>I am not sure. Should be straighforward but it might be non-trivial to 
>get the behavior "quite right". In my experience it takes a lot of 
>tweaking until such a change has exactly the effect that you intend in 
>all the possible different cases.

I have tried this minimalistic change:

**************************
diff -u 'src/Edit/Modify/edit_text.cpp.0' 'src/Edit/Modify/edit_text.cpp'
--- src/Edit/Modify/edit_text.cpp.0     2009-11-19 20:43:01.000000000 +0100
+++ src/Edit/Modify/edit_text.cpp       2009-12-05 12:39:55.000000000 +0100
@@ -197,6 +197,7 @@
 
 void
 edit_text_rep::insert_tree (tree t, path p_in_t) {
+    selection_get_cut () ; // delete existing selection to get overwrite
behavior
   if (is_atomic (t) && (p_in_t == end (t)) &&
       is_atomic (subtree (et, path_up (tp))))
     insert (tp, t);

******************************

It seems to to the trick (deleting any existing selection prior to adding
stuff to the document). I have not yet extensively tested it, though.
Moreover, since I don't know the overall architecture of the project, it may
introduce really bad side effects in some cases. So, it's better to have it
checked by an "architect".

best,
Philippe


_______________________________________________
Texmacs-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/texmacs-dev



-- 
View this message in context: 
http://old.nabble.com/Patches%3A-copy-paste-and-selection-handling.-tp21634429p26655064.html
Sent from the Gnu - Texmacs - Dev mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]