diff options
author | Jonathan Slenders <jonathan@slenders.be> | 2015-12-30 05:22:21 +0100 |
---|---|---|
committer | Jonathan Slenders <jonathan@slenders.be> | 2015-12-30 05:22:29 +0100 |
commit | 759d098dd8a4a03b3bb5767dfb01fe1ead90e662 (patch) | |
tree | 17af7d3d757aa2644427ddf95f9c60e473a5406c | |
parent | ce937c4274fbab50af9085cc3d8c41b336c0ad96 (diff) |
Bugfix in Document.selection_ranges.
-rw-r--r-- | prompt_toolkit/document.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/prompt_toolkit/document.py b/prompt_toolkit/document.py index d29d0c21..26adda0c 100644 --- a/prompt_toolkit/document.py +++ b/prompt_toolkit/document.py @@ -607,7 +607,7 @@ class Document(object): line_length = len(lines[l]) if from_column < line_length: yield (self.translate_row_col_to_index(l, from_column), - self.translate_row_col_to_index(l, min(line_length, to_column))) + self.translate_row_col_to_index(l, min(line_length - 1, to_column))) else: # In case of a LINES selection, go to the start/end of the lines. if self.selection.type == SelectionType.LINES: |