Skip to content

Commit 8beda8d

Browse files
committed
ADDED: Selection box ignores arrows
arrows selection in selection box dragging is changed to not selected the new default behavior can be changed by: - setting option DRAG_SELECTS_ARROWS in setup/asciio_object/basic.pl or setup/Text/asciio_object/basic.pl - dynamically in action group arrow (a) then 'drag_selects_arrows' (Alt-s)
1 parent 17d4759 commit 8beda8d

File tree

6 files changed

+19
-1
lines changed

6 files changed

+19
-1
lines changed

lib/App/Asciio/Actions/Arrow.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ use App::Asciio::Actions::Multiwirl ;
1212

1313
#----------------------------------------------------------------------------------------------
1414

15+
sub drag_selects_arrows { my ($self) = @_ ; $self->{DRAG_SELECTS_ARROWS} ^= 1 ; $self->update_display() ; }
16+
17+
#----------------------------------------------------------------------------------------------
18+
1519
sub interactive_change_arrow_direction
1620
{
1721
my ($self) = @_ ;

lib/App/Asciio/Actions/Mouse.pm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,17 @@ if($self->{PREVIOUS_X} != $x || $self->{PREVIOUS_Y} != $y)
353353
{
354354
if ($self->{DRAGGING} eq 'move') { $self->move_elements_event($x, $y) ; }
355355
elsif ($self->{DRAGGING} eq 'resize') { $self->resize_element_event($x, $y) ; }
356-
elsif ($self->{DRAGGING} eq 'select') { $self->select_element_event($x, $y) ; }
356+
elsif ($self->{DRAGGING} eq 'select')
357+
{
358+
if($self->{DRAG_SELECTS_ARROWS})
359+
{
360+
$self->select_element_event($x, $y) ;
361+
}
362+
else
363+
{
364+
$self->select_element_event($x, $y, sub { my $element = shift ; ref($_) !~ /arrow/ ;}) ;
365+
}
366+
}
357367

358368
($self->{PREVIOUS_X}, $self->{PREVIOUS_Y}) = ($x, $y) ;
359369
}

setup/Text/actions/vim_bindings.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
'Remove last section from multi_wirl' => ['A-C-s'],
185185
'Start no disconnect' => ['C-d'],
186186
'End no disconnect' => ['A-D'],
187+
'Flip drag selects arrows' => ['A-s'],
187188
},
188189

189190
'<< debug leader >>' =>

setup/Text/asciio_object/basic.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
TAB_AS_SPACES => ' ',
1212
USE_BINDINGS_COMPLETION => 0,
13+
DRAG_SELECTS_ARROWS => 0,
1314

1415
# use ANSI colors
1516
COLOR_SCHEMES =>

setup/actions/default_bindings.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
'Remove last section from multi_wirl' => ['CA0-s', \&App::Asciio::Actions::Multiwirl::remove_last_section_from_section_wirl_arrow ],
211211
'Start no disconnect' => ['C00-d', \&App::Asciio::Actions::Multiwirl::disable_arrow_connector, 0 ],
212212
'End no disconnect' => ['0A0-d', \&App::Asciio::Actions::Multiwirl::disable_arrow_connector, 1 ],
213+
'Flip drag selects arrows' => ['0A0-s', \&App::Asciio::Actions::Arrow::drag_selects_arrows ],
213214
},
214215

215216
'<< debug leader >>' =>

setup/asciio_object/basic.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
MOUSE_X => 0,
2626
MOUSE_Y => 0,
2727
ACTION_VERBOSE => undef,
28+
DRAG_SELECTS_ARROWS => 0,
2829

2930
COLORS => {},
3031

0 commit comments

Comments
 (0)