-
Notifications
You must be signed in to change notification settings - Fork 16
don't rebuild VF #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
don't rebuild VF #430
Changes from all commits
9a7f789
6a92e49
bb157cb
145f766
099eb6e
f657014
9761719
912234c
fcd1f47
8c43cd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -352,7 +352,7 @@ interface ActionBuilder extends Function<KeyEvent, ActionCmd>{} | |||||||||||||||||||||||||||||||||||||||||||||
| private final Map<String, Image> imageCache = new ConcurrentHashMap<>(); | ||||||||||||||||||||||||||||||||||||||||||||||
| private final SmartTimer objectsCacheEvictionTimer; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| private final Consumer<TextBuffer.Event> textChangeListener = e -> refreshTextFlow(); | ||||||||||||||||||||||||||||||||||||||||||||||
| private final Consumer<TextBuffer.Event> textChangeListener = e -> textBufferChanged(e); | ||||||||||||||||||||||||||||||||||||||||||||||
| int lastValidCaretPosition = -1; | ||||||||||||||||||||||||||||||||||||||||||||||
| int mouseDragStart = -1; | ||||||||||||||||||||||||||||||||||||||||||||||
| int dragAndDropStart = -1; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -834,6 +834,15 @@ private void updatePromptNodeLocation() { | |||||||||||||||||||||||||||||||||||||||||||||
| promptNode.relocate(x, origin.getY()); | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| private void textBufferChanged(TextBuffer.Event e) { | ||||||||||||||||||||||||||||||||||||||||||||||
| nonTextNodes.set(0); | ||||||||||||||||||||||||||||||||||||||||||||||
| viewModel.resetCharacterIterator(); | ||||||||||||||||||||||||||||||||||||||||||||||
| if (nonTextNodesCount != nonTextNodes.get()) { | ||||||||||||||||||||||||||||||||||||||||||||||
| // when number of images changes, caret | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
| requestLayout(); | ||||||||||||||||||||||||||||||||||||||||||||||
| nonTextNodesCount = nonTextNodes.get(); | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+838
to
+843
|
||||||||||||||||||||||||||||||||||||||||||||||
| nonTextNodes.set(0); | |
| viewModel.resetCharacterIterator(); | |
| if (nonTextNodesCount != nonTextNodes.get()) { | |
| // when number of images changes, caret | |
| requestLayout(); | |
| nonTextNodesCount = nonTextNodes.get(); | |
| objectsCacheEvictionTimer.pause(); | |
| try { | |
| nonTextNodes.set(0); | |
| viewModel.resetCharacterIterator(); | |
| // this ensures changes in decoration are applied: | |
| paragraphListView.updateLayout(); | |
| computeFullHeight(); | |
| if (nonTextNodesCount != nonTextNodes.get()) { | |
| // when number of images changes, caret | |
| requestLayout(); | |
| nonTextNodesCount = nonTextNodes.get(); | |
| } | |
| getSkinnable().requestFocus(); | |
| } finally { | |
| objectsCacheEvictionTimer.start(); |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Event parameter 'e' is not used in this method, but there are different event types (InsertEvent, DeleteEvent, DecorateEvent) available in TextBuffer.Event. Consider using the event type to determine whether certain operations are needed. For example, DecorateEvent might specifically require paragraphListView.updateLayout() to ensure decoration changes are applied, while InsertEvent and DeleteEvent might not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lambda expression can be simplified to a method reference for better readability.