Github user emilianbold commented on a diff in the pull request:
https://github.com/apache/jmeter/pull/300#discussion_r131213400
--- Diff: src/core/org/apache/jmeter/gui/UndoHistory.java ---
@@ -160,63 +133,46 @@ public void add(JMeterTreeModel treeModel, String
comment) {
// first clone to not convert original tree
tree = (HashTree) tree.getTree(tree.getArray()[0]).clone();
- position++;
- while (history.size() > position) {
- if (log.isDebugEnabled()) {
- log.debug("Removing further record, position: {}, size:
{}", position, history.size());
- }
- history.remove(history.size() - 1);
- }
-
// cloning is required because we need to immute stored data
HashTree copy = UndoCommand.convertAndCloneSubTree(tree);
- history.add(new UndoHistoryItem(copy, comment));
+ GuiPackage guiPackage = GuiPackage.getInstance();
+ //or maybe a Boolean?
+ boolean dirty = guiPackage != null ? guiPackage.isDirty() : false;
--- End diff --
The fact that we have the `CheckDirty` class and `GuiPackage.isDirty` makes
me think there's room for bugs. I haven't really tried to fix the underlying
design, just build upon it to see if I can also undo/redo the dirty flag.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---