Skip to content

Commit

Permalink
fix unsaved buffers pyright incompatibility (#2360)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Nov 10, 2023
1 parent 0ef280f commit d5be23a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugin/core/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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://sublime/{}".format(view.buffer_id())
return "buffer://{}".format(view.buffer_id())
return filename_to_uri(file_name)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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://sublime/42")
self.assertEqual(uri, "buffer://42")

0 comments on commit d5be23a

Please sign in to comment.