mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RIDER-114196 Sticky lines: add api to receive notification when all sticky lines are removed
GitOrigin-RevId: e97a4ab6523f03c5a452323375548f2c91048023
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ca4b559d8a
commit
56d2fb7229
+1
-1
@@ -126,7 +126,7 @@ class StickyLinesCollector(private val project: Project, private val document: D
|
||||
", old removed: ${outdatedLines.size}" +
|
||||
", ${debugPsiFile(psiFile)}"
|
||||
}
|
||||
stickyModel.notifyListeners()
|
||||
stickyModel.notifyLinesUpdate()
|
||||
}
|
||||
|
||||
private fun stickyLinesModel(psiFile: PsiFile): StickyLinesModel? {
|
||||
|
||||
+4
-1
@@ -102,10 +102,13 @@ internal class StickyLinesManager(
|
||||
}
|
||||
}
|
||||
|
||||
override fun modelChanged() {
|
||||
override fun linesUpdated() {
|
||||
recalculateAndRepaintLines()
|
||||
}
|
||||
|
||||
override fun linesRemoved() {
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
stickyModel.removeListener(this)
|
||||
}
|
||||
|
||||
+10
-2
@@ -48,7 +48,7 @@ public interface StickyLinesModel {
|
||||
|
||||
void removeListener(@NotNull Listener listener);
|
||||
|
||||
void notifyListeners();
|
||||
void notifyLinesUpdate();
|
||||
|
||||
/**
|
||||
* Marker associated with sticky line to distinguish the highlighting daemon which produced the line.
|
||||
@@ -68,6 +68,14 @@ public interface StickyLinesModel {
|
||||
}
|
||||
|
||||
interface Listener {
|
||||
void modelChanged();
|
||||
/**
|
||||
* Called when a batch of sticky lines is added or removed
|
||||
*/
|
||||
void linesUpdated();
|
||||
|
||||
/**
|
||||
* Called when all sticky lines are removed
|
||||
*/
|
||||
void linesRemoved();
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -145,9 +145,9 @@ public final class StickyLinesModelImpl implements StickyLinesModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyListeners() {
|
||||
public void notifyLinesUpdate() {
|
||||
for (Listener listener : myListeners) {
|
||||
listener.modelChanged();
|
||||
listener.linesUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,6 +159,9 @@ public final class StickyLinesModelImpl implements StickyLinesModel {
|
||||
for (StickyLine line : getAllStickyLines()) {
|
||||
removeStickyLine(line);
|
||||
}
|
||||
for (Listener listener : myListeners) {
|
||||
listener.linesRemoved();
|
||||
}
|
||||
if (project != null) {
|
||||
restartStickyLinesPass(project);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user