Commit notifications for all Sup repositories
 help / color / mirror / Atom feed
* [sup.git] branch develop updated (a17638d3 -> cf3a2e38)
@ 2026-10-10 21:23 Dan Callaghan
  2026-10-10 21:23 ` [sup.git] 01/02: fix ambiguous / warning in new emit_xterm_title method Dan Callaghan
  2026-10-10 21:23 ` [sup.git] 02/02: rewrite ThreadIndexMode#multi_kill to work like the other label methods Dan Callaghan
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Callaghan @ 2026-10-10 21:23 UTC (permalink / raw)
  To: sup-commits

Pushed branch develop:
    from a17638d3 tests: fix TestLineCursorMode failures due to Ncurses.tigetflag
     new 0d6a14bc fix ambiguous / warning in new emit_xterm_title method
     new cf3a2e38 rewrite ThreadIndexMode#multi_kill to work like the other label methods


Summary of changes:
 lib/sup/buffer.rb                  |  2 +-
 lib/sup/modes/thread_index_mode.rb | 55 +++++++++++++++++++-------------------
 2 files changed, 29 insertions(+), 28 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [sup.git] 01/02: fix ambiguous / warning in new emit_xterm_title method
  2026-10-10 21:23 [sup.git] branch develop updated (a17638d3 -> cf3a2e38) Dan Callaghan
@ 2026-10-10 21:23 ` Dan Callaghan
  2026-10-10 21:23 ` [sup.git] 02/02: rewrite ThreadIndexMode#multi_kill to work like the other label methods Dan Callaghan
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Callaghan @ 2026-10-10 21:23 UTC (permalink / raw)
  To: sup-commits

New commit on branch develop:
https://supmua.dev/git/sup/commit/0d6a14bced9838695575c1e112dc3ecbfb299c8c.html

commit 0d6a14bced9838695575c1e112dc3ecbfb299c8c
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Sat Oct 10 18:08:03 2026 +1100

    fix ambiguous / warning in new emit_xterm_title method
    
        lib/sup/buffer.rb:301: warning: ambiguous `/`; wrap regexp in parentheses or add a space after `/` operator
---
 lib/sup/buffer.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index 7561d54d..75becf24 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -298,7 +298,7 @@ EOS
     ## Screen does not properly handle characters above U+FF in the title.
     ## It truncates them to 8 bits which may cause it to emit control
     ## characters into the terminal title.
-    title = title.gsub /[^\u0000-\u00ff]/, "?" if ENV["TERM"] =~ /screen/
+    title = title.gsub(/[^\u0000-\u00ff]/, "?") if ENV["TERM"] =~ /screen/
     print "\033]0;#{title}\07"
   end
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [sup.git] 02/02: rewrite ThreadIndexMode#multi_kill to work like the other label methods
  2026-10-10 21:23 [sup.git] branch develop updated (a17638d3 -> cf3a2e38) Dan Callaghan
  2026-10-10 21:23 ` [sup.git] 01/02: fix ambiguous / warning in new emit_xterm_title method Dan Callaghan
@ 2026-10-10 21:23 ` Dan Callaghan
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Callaghan @ 2026-10-10 21:23 UTC (permalink / raw)
  To: sup-commits

New commit on branch develop:
https://supmua.dev/git/sup/commit/cf3a2e38fcc81e0515ea0557c6f837fd3cfdb269.html

commit cf3a2e38fcc81e0515ea0557c6f837fd3cfdb269
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Sat Oct 10 20:34:24 2026 +1100

    rewrite ThreadIndexMode#multi_kill to work like the other label methods
    
    Avoids race conditions which arise from invoking Index.save_thread
    before regen_text.
    
    Fixes #488.
---
 lib/sup/modes/thread_index_mode.rb | 55 +++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 27 deletions(-)

diff --git a/lib/sup/modes/thread_index_mode.rb b/lib/sup/modes/thread_index_mode.rb
index 4172f3e0..4414d35d 100644
--- a/lib/sup/modes/thread_index_mode.rb
+++ b/lib/sup/modes/thread_index_mode.rb
@@ -494,6 +494,29 @@ EOS
     threads.each { |t| Index.save_thread t }
   end
 
+  ## returns an undo lambda
+  def actually_toggle_killed t
+    if t.has_label? :killed
+      t.remove_label :killed
+      add_or_unhide t.first
+      UpdateManager.relay self, :labeled, t.first
+      lambda do
+        t.apply_label :killed
+        hide_thread t
+        UpdateManager.relay self, :labeled, t.first
+      end
+    else
+      t.apply_label :killed
+      hide_thread t
+      UpdateManager.relay self, :labeled, t.first
+      lambda do
+        t.remove_label :killed
+        add_or_unhide t.first
+        UpdateManager.relay self, :labeled, t.first
+      end
+    end
+  end
+
   def kill
     t = cursor_thread or return
     multi_kill [t]
@@ -507,35 +530,13 @@ EOS
 
   ## m-m-m-m-MULTI-KILL
   def multi_kill threads
-    UndoManager.register "killing/unkilling #{threads.size.pluralize 'threads'}" do
-      threads.each do |t|
-        if t.toggle_label :killed
-          add_or_unhide t.first
-        else
-          hide_thread t
-        end
-      end.each do |t|
-        UpdateManager.relay self, :labeled, t.first
-        Index.save_thread t
-      end
-      regen_text
-    end
-
-    threads.each do |t|
-      if t.toggle_label :killed
-        hide_thread t
-      else
-        add_or_unhide t.first
-      end
-    end.each do |t|
-      # send 'labeled'... this might be more specific
-      UpdateManager.relay self, :labeled, t.first
-      Index.save_thread t
-    end
-
+    undos = threads.map { |t| actually_toggle_killed t }
+    UndoManager.register "killing/unkilling #{threads.size.pluralize 'threads'}", undos,
+                         lambda { regen_text }, lambda { threads.each { |t| Index.save_thread t } }
+    regen_text
+    threads.each { |t| Index.save_thread t }
     killed, unkilled = threads.partition { |t| t.has_label? :killed }.map(&:size)
     BufferManager.flash "#{killed.pluralize 'thread'} killed, #{unkilled} unkilled"
-    regen_text
   end
 
   def cleanup

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-10 21:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-10 21:23 [sup.git] branch develop updated (a17638d3 -> cf3a2e38) Dan Callaghan
2026-10-10 21:23 ` [sup.git] 01/02: fix ambiguous / warning in new emit_xterm_title method Dan Callaghan
2026-10-10 21:23 ` [sup.git] 02/02: rewrite ThreadIndexMode#multi_kill to work like the other label methods Dan Callaghan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox