texmacs-dev
[Top][All Lists]
Advanced

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

[Texmacs-dev] One more patch to cut&paste


From: Norbert Nemec
Subject: [Texmacs-dev] One more patch to cut&paste
Date: Thu, 11 Jun 2009 07:23:09 +0100
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Hi there,

attached is one more patch to the cut&paste mechanism.

Greetings,
Norbert
Do selection_get_cut operations on the "tmp" buffer by default. The "primary" 
buffer should only be used by explicit cut&paste operations by the user.

From:  <>


---

 src/src/Edit/Replace/edit_select.cpp |   42 +++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 21 deletions(-)


diff --git a/src/src/Edit/Replace/edit_select.cpp 
b/src/src/Edit/Replace/edit_select.cpp
index 571609a..82f7711 100644
--- a/src/src/Edit/Replace/edit_select.cpp
+++ b/src/src/Edit/Replace/edit_select.cpp
@@ -801,27 +801,27 @@ edit_select_rep::raw_cut (path p1, path p2) {
 void
 edit_select_rep::selection_cut (string key) {
   if (inside_active_graphics ()) {
-    tree t= as_tree (eval ("(graphics-cut)"));
-    selection_set (key, t);
-    return;
-  }
-  if (!selection_active_any ()) return;
-  if (selection_active_table ()) {
-    path p1= start_p, p2= end_p;
-    tree sel= selection_get ();
-    selection_set (key, sel);
-    cut (p1, p2);
-  }
-  else {
+    if(key != "none") {
+      tree t= as_tree (eval ("(graphics-cut)"));
+      selection_set (key, t);
+    }
+  } else if (selection_active_any ()) {
     path p1, p2;
-    selection_get (p1, p2);
-    go_to (p2);
-    if (p2 == p1) return;
-
-    tree sel= compute_selection (et, p1, p2);
-    // cout << "Selection " << sel << "\n";
-    selection_set (key, simplify_correct (sel));
-    // cout << "Selected  " << sel << "\n";
+    if (selection_active_table ()) {
+      p1= start_p; p2= end_p;
+      if(key != "none") {
+        tree sel= selection_get ();
+        selection_set (key, sel);
+      }
+    } else {
+      selection_get (p1, p2);
+      go_to (p2);
+      if (p2 == p1) return;
+      if(key != "none") {
+        tree sel= compute_selection (et, p1, p2);
+        selection_set (key, simplify_correct (sel));
+      }
+    }
     cut (p1, p2);
   }
 }
@@ -829,7 +829,7 @@ edit_select_rep::selection_cut (string key) {
 tree
 edit_select_rep::selection_get_cut () {
   tree t= selection_get ();
-  selection_cut ();
+  selection_cut ("none");
   return t;
 }
 

reply via email to

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