zamotivator

Untitled

Apr 3rd, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. diff -ruN a/src/command.C b/src/command.C
  2. --- a/src/command.C 2013-04-03 20:51:44.467076894 +0900
  3. +++ b/src/command.C 2013-04-03 20:52:00.730410475 +0900
  4. @@ -522,7 +522,7 @@
  5. }
  6. }
  7. #ifdef SCROLL_ON_UPDOWN_KEYS
  8. - if (IS_SCROLL_MOD)
  9. + if (IS_SCROLL_MOD && !ctrl)
  10. {
  11. if (keysym == XK_Up)
  12. {
  13. diff -ruN a/src/feature.h b/src/feature.h
  14. --- a/src/feature.h 2013-04-03 20:51:44.467076894 +0900
  15. +++ b/src/feature.h 2013-04-03 21:00:02.733751171 +0900
  16. @@ -117,7 +117,7 @@
  17. * SCROLL_ON_* defines above.).
  18. * Also for modifier+Home/End keys to move to top/bottom
  19. */
  20. -/* #define SCROLL_ON_UPDOWN_KEYS */
  21. +#define SCROLL_ON_UPDOWN_KEYS
  22. /* #define SCROLL_ON_HOMEEND_KEYS */
  23.  
  24. /*
  25. diff -ruN a/src/perl/tabbed b/src/perl/tabbed
  26. --- a/src/perl/tabbed 2013-04-03 20:51:44.460410226 +0900
  27. +++ b/src/perl/tabbed 2013-04-03 20:54:48.527079704 +0900
  28. @@ -348,31 +348,32 @@
  29. sub tab_key_press {
  30. my ($self, $tab, $event, $keysym, $str) = @_;
  31.  
  32. - if ($event->{state} & urxvt::ShiftMask) {
  33. - if ($keysym == 0xff51 || $keysym == 0xff53) {
  34. - my ($idx) = grep $self->{tabs}[$_] == $tab, 0 .. $#{ $self->{tabs} };
  35. -
  36. - --$idx if $keysym == 0xff51;
  37. - ++$idx if $keysym == 0xff53;
  38. + if (($keysym == 0xff54) &&
  39. + (($event->{state} & urxvt::ControlMask) ||
  40. + ($event->{state} & urxvt::ShiftMask)))
  41. + {
  42. + $self->new_tab;
  43. + return 1;
  44. + } elsif ($event->{state} & urxvt::ControlMask) {
  45. + if ($keysym == 0xff51 || $keysym == 0xff53) {
  46. + my ($idx1) = grep $self->{tabs}[$_] == $tab, 0 .. $#{ $self->{tabs} };
  47. + my $idx2 = ($idx1 + ($keysym == 0xff51 ? -1 : +1)) % @{ $self->{tabs} };
  48.  
  49. - $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]);
  50. + ($self->{tabs}[$idx1], $self->{tabs}[$idx2]) =
  51. + ($self->{tabs}[$idx2], $self->{tabs}[$idx1]);
  52.  
  53. - return 1;
  54. - } elsif ($keysym == 0xff54) {
  55. - $self->new_tab;
  56. + $self->make_current ($self->{tabs}[$idx2]);
  57.  
  58. return 1;
  59. }
  60. - }
  61. - elsif ($event->{state} & urxvt::ControlMask) {
  62. + } elsif ($event->{state} & urxvt::ShiftMask) {
  63. if ($keysym == 0xff51 || $keysym == 0xff53) {
  64. - my ($idx1) = grep $self->{tabs}[$_] == $tab, 0 .. $#{ $self->{tabs} };
  65. - my $idx2 = ($idx1 + ($keysym == 0xff51 ? -1 : +1)) % @{ $self->{tabs} };
  66. + my ($idx) = grep $self->{tabs}[$_] == $tab, 0 .. $#{ $self->{tabs} };
  67.  
  68. - ($self->{tabs}[$idx1], $self->{tabs}[$idx2]) =
  69. - ($self->{tabs}[$idx2], $self->{tabs}[$idx1]);
  70. + --$idx if $keysym == 0xff51;
  71. + ++$idx if $keysym == 0xff53;
  72.  
  73. - $self->make_current ($self->{tabs}[$idx2]);
  74. + $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]);
  75.  
  76. return 1;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment