diff --git a/plugin/core/views.py b/plugin/core/views.py index 983e6faf5..2e5dabcd3 100644 --- a/plugin/core/views.py +++ b/plugin/core/views.py @@ -340,11 +340,6 @@ def region_to_range(view: sublime.View, region: sublime.Region) -> Range: } -def is_range_equal(lhs: Range, rhs: Range) -> bool: - return lhs['start']['line'] == rhs['start']['line'] and lhs['start']['character'] == rhs['start']['character'] and \ - lhs['end']['line'] == rhs['end']['line'] and lhs['end']['character'] == rhs['end']['character'] - - def to_encoded_filename(path: str, position: Position) -> str: # WARNING: Cannot possibly do UTF-16 conversion :) Oh well. return '{}:{}:{}'.format(path, position['line'] + 1, position['character'] + 1) diff --git a/plugin/session_buffer.py b/plugin/session_buffer.py index af1454340..10e45208e 100644 --- a/plugin/session_buffer.py +++ b/plugin/session_buffer.py @@ -24,7 +24,6 @@ from .core.views import document_color_params from .core.views import DOCUMENT_LINK_FLAGS from .core.views import entire_content_range -from .core.views import is_range_equal from .core.views import lsp_color_to_phantom from .core.views import MissingUriError from .core.views import range_to_region @@ -389,7 +388,7 @@ def get_document_link_at_point(self, view: sublime.View, point: int) -> Optional def update_document_link(self, new_link: DocumentLink) -> None: new_link_range = new_link["range"] for link in self.document_links: - if is_range_equal(link["range"], new_link_range): + if link["range"] == new_link_range: self.document_links.remove(link) self.document_links.append(new_link) break