Skip to content

Commit

Permalink
Editor: add to watch don't create extra empty items
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Nov 12, 2024
1 parent 4ec0426 commit 626ddcc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Editor/AGS.Editor/GUI/WatchVariablesPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,21 @@ private void listView1_MouseUp(object sender, MouseEventArgs e)
}
}

private ListViewItem AddToListView(ListViewItem item)
{
if (listView1.Items.Count > 0 && listView1.Items[listView1.Items.Count - 1].Text.Length == 0)
{
listView1.Items[listView1.Items.Count - 1].Remove();
}

item = listView1.Items.Add(item);
EnsureEmptyItem();
return item;
}

public void AddVariableToWatchList(string var_name)
{
ListViewItem item = listView1.Items.Add(CreateItem(var_name));
ListViewItem item = AddToListView(CreateItem(var_name));
lock (_updateItemLock)
_itemsToUpdate.Add(item);
_updateItemTimer.Start();
Expand Down

0 comments on commit 626ddcc

Please # to comment.