emacsorphanage / helm-swoop

Efficiently hopping squeezed lines powered by Emacs helm interface
GNU General Public License v3.0
689 stars 55 forks source link

Helm edit messes up when using certain Evil commands #61

Open hura opened 9 years ago

hura commented 9 years ago

When I do a helm swoop and then edit the findings and use Evil commands (such as "ct") to change the content. The end result will be completely messed up. This is the git diff where I wanted to rename :mult-ch to :log-sub-ch. The first one I did manually and it worked fine. However to speed things up I usually try to use one command and then use . to repeat it (Evil). You can see lines disappearing and appearing at the end of the file. Also some lines are removed and joined later on:

@@ -45,7 +45,7 @@
          {:log-pub-ch nil                ; Where ALL logs will be pushed.
                                         ; The raw log events including time, ns,
-          :mult-ch nil                  ; Tap into the log-in-ch with mult
+          :log-sub-ch nil                  ; Tap into the log-in-ch with mult
                                         ; distributes log events to multiple
                                         ; other channels
           ;; The actions channel
@@ -136,7 +136,7 @@
   "Return true if the namespace p is a parent of c.
   Expects two string"
   [^String p ^String c]
-  ;; :log-pub-ch -> :mult-ch -> :logs  ;;{:pre [(and (string? p) (string? c))]}
+
   (let [pd (str p ".")]
     (= (subs c 0 (count pd)) pd)))

@@ -274,7 +274,7 @@
       [:ul {:style {:padding ".5em"
                     :margin "0em"
                     :line-height "2.0em"}}
-       (for [tab (keys (:tabs @db))]
+  ;; :log-pub-ch -> :log-sub-ch -> :logs  ;;{:pre [(and (string? p) (string? c))]}       (for [tab (keys (:tabs @db))]
          ^{:key tab} [render-tab-item db tab])]]
      ;;;;;;;;;; The main log ;;;;;;;;;
      [:div.klang-logs
@@ -360,7 +360,7 @@
   [db logs]
   ;; We have a big buffer here since if we're in a frozen state the buffer will
   ;; be filling up since we won't take anything out from the channel.
-  (let [lg-ch (tap (:mult-ch @db) (chan (sliding-buffer 1000)))
+  (let [lg-ch (tap (:log-sub-ch @db) (chan (sliding-buffer 1000)))
         freeze-ch (:freeze-chan @db)]
     (go-loop [is-frozen false]
       ;; l-chans: What ch to listen
@@ -387,7 +387,7 @@
    (swap! db assoc :freeze-chan (chan))
    ;; Create mutli channel for the main log-in-ch
    ;; This is so the user can also listen on any log messages
-   (swap! db assoc :mult-ch (mult (:log-pub-ch @db)))
+
    (ch-to-logs! db logs)
    (ensure-hljs-css!)
    (log-console "Klang: Logging initialized.")))
@@ -555,7 +555,7 @@
   Example:
   (msg->console! db :CONSOLE)"
   [db type]
-  (let [ch (tap (:mult-ch @db) (chan 10))]
+  (let [ch (tap (:log-sub-ch @db) (chan 10))]
     (go-loop []
       (let [lg (<! ch)] 
         ;; This logs the object to the console an allow it to inspect.
@@ -692,3 +692,4 @@
   ;;   o time?

   )
+   (swap! db assoc :log-sub-ch (mult (:log-pub-ch @db)))

It does work if I use cw (change word) but not if I use ct<space>. So it seems to only be certain Evil commands.