summaryrefslogtreecommitdiff
path: root/alot/completion
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2019-08-17 10:34:31 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2019-08-17 11:10:37 +0100
commit96308edb406bfe57437a6b662d8a20cb7f1b9778 (patch)
tree825419fd6c076ec850d76ccfd6faa0ca2c8c4309 /alot/completion
parent0f4fbc8886cb3571828083cce27e8fd88bc7d220 (diff)
cleanup: remove unused parameter
... to Completer.relevant_part
Diffstat (limited to 'alot/completion')
-rw-r--r--alot/completion/completer.py14
-rw-r--r--alot/completion/multipleselection.py2
2 files changed, 8 insertions, 8 deletions
diff --git a/alot/completion/completer.py b/alot/completion/completer.py
index de15d312..6894bb88 100644
--- a/alot/completion/completer.py
+++ b/alot/completion/completer.py
@@ -11,8 +11,8 @@ class Completer:
@abc.abstractmethod
def complete(self, original, pos):
- """returns a list of completions and cursor positions for the
- string original from position pos on.
+ """returns a list of completions and cursor positions for the string
+ `original` from position `pos` on.
:param original: the string to complete
:type original: str
@@ -25,13 +25,13 @@ class Completer:
"""
pass
- def relevant_part(self, original, pos, sep=' '):
+ def relevant_part(self, original, pos):
"""
- calculates the subword in a `sep`-splitted list of substrings of
- `original` that `pos` is ia.n
+ Calculate the subword in a ' '-separated list of substrings of
+ `original` that `pos` is in.
"""
- start = original.rfind(sep, 0, pos) + 1
- end = original.find(sep, pos - 1)
+ start = original.rfind(' ', 0, pos) + 1
+ end = original.find(' ', pos - 1)
if end == -1:
end = len(original)
return original[start:end], start, end, pos - start
diff --git a/alot/completion/multipleselection.py b/alot/completion/multipleselection.py
index 8ceb9ed6..45de5a28 100644
--- a/alot/completion/multipleselection.py
+++ b/alot/completion/multipleselection.py
@@ -25,7 +25,7 @@ class MultipleSelectionCompleter(Completer):
self._completer = completer
self._separator = separator
- def relevant_part(self, original, pos, sep=' '):
+ def relevant_part(self, original, pos):
"""Calculate the subword of `original` that `pos` is in."""
start = original.rfind(self._separator, 0, pos)
if start == -1: