From 31eb6ca97020cbf273606c00f40eb7acbd9a257b Mon Sep 17 00:00:00 2001 From: Rafal Chlodnicki Date: Sun, 12 Nov 2023 11:55:48 +0100 Subject: [PATCH] improve buffer URI format --- plugin/core/url.py | 2 +- tests/test_url.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/core/url.py b/plugin/core/url.py index 696ef9056..5e82d736c 100644 --- a/plugin/core/url.py +++ b/plugin/core/url.py @@ -26,7 +26,7 @@ def filename_to_uri(file_name: str) -> str: def view_to_uri(view: sublime.View) -> str: file_name = view.file_name() if not file_name: - return "buffer://{}".format(view.buffer_id()) + return "buffer:View-{}".format(view.buffer_id()) return filename_to_uri(file_name) diff --git a/tests/test_url.py b/tests/test_url.py index 532278da5..b90d6d7f6 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -70,4 +70,4 @@ def test_buffer_uri(self): view.file_name = unittest.mock.MagicMock(return_value=None) view.buffer_id = unittest.mock.MagicMock(return_value=42) uri = view_to_uri(view) - self.assertEqual(uri, "buffer://42") + self.assertEqual(uri, "buffer:View-42")