summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-28 14:46:26 +0200
committerhut <hut@lavabit.com>2010-03-28 14:46:26 +0200
commitad482d30ff5564979c7789906cc53d4ed8920ae2 (patch)
tree318c9d6798f18d50392efde90b460779f03da879 /ranger
parent636f69d346e31ee59702c814574c1379aa9cb8e6 (diff)
downloadranger-ad482d30ff5564979c7789906cc53d4ed8920ae2.tar.gz
commands: don't ask for confirmation when deleting single links
Diffstat (limited to 'ranger')
-rw-r--r--ranger/defaults/commands.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py
index b1518013..2443c0d5 100644
--- a/ranger/defaults/commands.py
+++ b/ranger/defaults/commands.py
@@ -277,8 +277,11 @@ class delete(Command):
 			# user did not confirm deletion
 			return
 
-		if self.fm.env.cwd.marked_items \
-		or (self.fm.env.cf.is_directory and not self.fm.env.cf.empty()):
+		cwd = self.fm.env.cwd
+		cf = self.fm.env.cf
+
+		if cwd.marked_items or \
+		(cf.is_directory and not cf.empty() and not cf.islink):
 			# better ask for a confirmation, when attempting to
 			# delete multiple files or a non-empty directory.
 			return self.fm.open_console(self.mode, delete.WARNING)
9-12-13 19:42:51 +0100 updated / added tests' href='/akspecs/ranger/commit/test/tc_displayable.py?h=v1.9.0b1&id=1159f9ec182496ddc5324f23fb1d5eae73fe63e3'>1159f9ec ^
e3e37e3f ^

1159f9ec ^




dd4a4145 ^


















































1159f9ec ^



f7819821 ^



1159f9ec ^
dd4a4145 ^



1159f9ec ^
















1159f9ec ^


dd4a4145 ^
1159f9ec ^
dd4a4145 ^





1159f9ec ^
dd4a4145 ^


1159f9ec ^
dd4a4145 ^


1159f9ec ^
1159f9ec ^


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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159