[Top][All Lists]

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

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

From: Norbert Nemec
Subject: Re: [Texmacs-dev] Patches: copy/paste and selection handling.
Date: Tue, 08 Dec 2009 17:41:03 +0000
User-agent: Thunderbird (X11/20090817)

selection_cut("none") is preferable to selection_get_cut() as it avoids copying the data which is then ignored anyway.

Otherwise, it seems fine to me. I have put it into my private repo and will test it.


Philippe Joyez wrote:
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 @@
 edit_text_rep::insert_tree (tree t, path p_in_t) {
+    selection_get_cut () ; // delete existing selection to get overwrite
   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".


Texmacs-dev mailing list

reply via email to

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