Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asking for confirmation, when trying to open more than one tagged thread at once #382

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/sup/modes/thread_index_mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,16 @@ def select t=nil, when_done=nil
end

def multi_select threads
threads.each { |t| select t }
tagged_no = @tags.number_of_tagged
if tagged_no > 1
total_msg_no = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inconsistent tab-width

threads.each { |t| total_msg_no += t.size }
if BufferManager.ask_yes_or_no "Are you sure, you want to open #{tagged_no} threads with #{total_msg_no} messages (y/n)?"
threads.each { |t| select t }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inconsistent tab width

end
else
threads.each { |t| select t }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inconsistent tab-width

end
end

## these two methods are called by thread-view-modes when the user
Expand Down
3 changes: 2 additions & 1 deletion lib/sup/tagger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def tag o; @tagged[o] = true; end
def untag o; @tagged[o] = false; end
def drop_all_tags; @tagged.clear; end
def drop_tag_for o; @tagged.delete o; end

def number_of_tagged; @tagged.select_by_value.size; end

def apply_to_tagged action=nil
targets = @tagged.select_by_value
num_tagged = targets.size
Expand Down