From 0cf4b058cd9e663dab1b12c15a95addb66113743 Mon Sep 17 00:00:00 2001 From: The Flying Rapist Date: Sun, 20 Mar 2016 02:34:52 -0400 Subject: Added toggle mode for cut/copy actions. --- ranger/config/rc.conf | 2 ++ ranger/core/actions.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 43a9b99a..44692d79 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -360,11 +360,13 @@ map dd cut map ud uncut map da cut mode=add map dr cut mode=remove +map dt cut mode=toggle map yy copy map uy uncut map ya copy mode=add map yr copy mode=remove +map yt copy mode=toggle # Temporary workarounds map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index e692eb39..89924dc0 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -1219,7 +1219,7 @@ class Actions(FileManagerAware, SettingsAware): Copy the selected items. Modes are: 'set', 'add', 'remove'. """ - assert mode in ('set', 'add', 'remove') + assert mode in ('set', 'add', 'remove', 'toggle') cwd = self.thisdir if not narg and not dirarg: selected = (f for f in self.thistab.get_selection() if f in cwd.files) @@ -1241,6 +1241,8 @@ class Actions(FileManagerAware, SettingsAware): self.copy_buffer.update(set(selected)) elif mode == 'remove': self.copy_buffer.difference_update(set(selected)) + elif mode == 'toggle': + self.copy_buffer.symmetric_difference_update(set(selected)) self.do_cut = False self.ui.browser.main_column.request_redraw() -- cgit 1.4.1-2-gfad0 ='hidden' name='id' value='d9d3243bdfeae03e7c4641bde73103748992b3dc'/>
path: root/TODO
blob: d715c99130848195f8ab37672d38bfb61fbb38d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96