Add an event listener to create an API to tell whether a view is cloned or not
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start by comparing the linked BufferScroll and SkipCloseForClonedViews implementations with the related Sublime Text Core requests for View.clones(). Determine how sublime_lib could expose reusable cloned-view detection through an event listener without the package-specific caching concerns being repeated. Done means the library provides the requested shared API and its behavior distinguishes primary views from views sharing an underlying buffer.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The View.is_primary() only tells if the view is the "primary". If the view is the "primary", it does not tell whether it has multiple views into the underlying buffer.
Some years ago, I wrote this code into my fork of BufferScroll:
https://github.com/evandrocoan/BufferScroll/blob/master/BufferScroll.py#L105-L117
And today, I need to write the same code for my new package:
https://github.com/evandrocoan/SkipCloseForClonedViews/blob/master/skip_close_for_cloned_views.py#L5-L70
Which implements this feature asked on Core:
- https://github.com/SublimeTextIssues/Core/issues/2903 Skip save (ask) when closing a cloned view
Nowadays, I am worried about performance, and I am running this is_cloned_view() very often. Then, for my new Package, I wrote a optimized version which caches whether a given buffer has several views into the same buffer.
How such peculiar API is_cloned(view) which requires to extend the sublime_plugin.EventListener be distributed and shared between several packages? Could it be added to sublime_lib?
Something very similar was already requested to be added into Sublime Text Core:
- https://github.com/SublimeTextIssues/Core/issues/11 "View.clones()" addition
Using that API, it would only require me to call len( view.clones() ) > 1 to know where some view is cloned, i.e., has clones, i.e., has several views into the same buffer. Then, optimally when integrating my implementation into sublime_lib, my original implementation could be extended to support this feature of returning all clones instead of only saying some view has clones or not.
- Ngôn ngữ chính
- Python
- Star
- 56
- Fork
- 5
- Merge trung bình
- 19 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SublimeText/sublime_lib
-
Conversion errorĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
SublimeText/sublime_lib#210 · 1 bình luận ·
-
documentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
SublimeText/sublime_lib#183 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 38/100
SublimeText/sublime_lib#173 · 1 reaction ·
-
Settings listener classesĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
SublimeText/sublime_lib#164 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
SublimeText/sublime_lib#141 · 2 bình luận ·
Tất cả issue của SublimeText/sublime_lib
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
FinanceFlash/unvibecode#509 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
FAIRmat-NFDI/nomad-distro-dev#161 ·
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
modelcontextprotocol/python-sdk#3821 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug severity:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Log-odds calibration uses upper middle score instead of median for even candidate setsCó thể đã có người làm @flysheep-ai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày