From 4ecb0fc04409848cd1385ce8932000e1c67a3dd1 Mon Sep 17 00:00:00 2001 From: toonn Date: Sat, 16 Jan 2021 20:55:21 +0100 Subject: transpose_subr: Remove check for equal regions There's no point transposing equal regions, the result would be the same. --- ranger/gui/widgets/console.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index 6c184395..816f341a 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -442,8 +442,7 @@ class Console(Widget): # pylint: disable=too-many-instance-attributes,too-many- def transpose_subr(self, line, x, y): # Transpose substrings x & y of line # x & y are tuples of length two containing positions of endpoints - if not (0 <= x[0] <= x[1] <= y[0] <= y[1] <= len(line) - or 0<= x[0] == y[0] <= x[1] == y[1] <= len(line)): + if not (0 <= x[0] < x[1] <= y[0] < y[1] <= len(line)): self.fm.notify("Tried to transpose invalid regions.", bad=True) return line -- cgit 1.4.1-2-gfad0 >akspecs <akspecs@tilde.institute>
about summary refs log tree commit diff stats
path: root/ranger/container/settingobject.py
blob: c8bd8b492529a6b3e12f0cad939fbc67d716563e (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
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