Add an event listener to create an API to tell whether a view is cloned or not
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 56
- フォーク
- 5
- 平均マージ
- 19分
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SublimeText/sublime_lib のほかの issue
-
Conversion errorオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
SublimeText/sublime_lib#210 · コメント 1 件 ·
-
documentation
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
SublimeText/sublime_lib#183 ·
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 38/100
SublimeText/sublime_lib#173 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
SublimeText/sublime_lib#164 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
SublimeText/sublime_lib#141 · コメント 2 件 ·
SublimeText/sublime_lib の issue をすべて見る
似ている issue
-
cost:cheap practicality:seen-in-the-wild severity:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
メンテナーはふだん 1 日以内に返信
-
area:security effort:S priority:P2 provider:local-libvirt status:ready type:docs
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
randomparity/kdive#3495 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/markitdown#2820 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信