Skip to content

Commit ee2c992

Browse files
authored
Merge branch 'corpnewt:master' into master
2 parents 9b5d5f3 + 67ba84d commit ee2c992

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Scripts/plistwindow.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ def get_mod_bitmask(self):
589589
bit_mask -= 0x2 # Caps Lock
590590
# bit_mask -= 0x4 # Ctrl, don't whitelist - used for keybinds
591591
bit_mask -= 0x8 # Num Lock
592+
bit_mask -= 0x20 # Scroll Lock
592593
# bit_mask -= 0x20000 # Alt, don't whitelist - used for File keybinds
593594
elif sys.platform == "darwin": # macOS
594595
bit_mask -= 0x1 # Shift
@@ -2418,7 +2419,9 @@ def paste_selection(self, event = None):
24182419
node = "" if not len(self._tree.selection()) else self._tree.selection()[0]
24192420
# Verify the type - or get the parent
24202421
t = self.get_check_type(node).lower()
2422+
index = 0
24212423
if not node == "" and (not t in ("dictionary","array") or (self._tree.get_children(node) and not self._tree.item(node,"open"))):
2424+
index = self._tree.index(node)+1
24222425
node = self._tree.parent(node)
24232426
node = self.get_root_node() if node == "" else node # Force Root node if need be
24242427
t = self.get_check_type(node).lower()
@@ -2446,12 +2449,14 @@ def paste_selection(self, event = None):
24462449
if isinstance(plist_data,dict):
24472450
dict_list = list(plist_data.items()) if not self.controller.settings.get("sort_dict",False) else sorted(list(plist_data.items()))
24482451
names = [self._tree.item(x,"text") for x in self._tree.get_children(node)] if t == "dictionary" else []
2449-
for (key,val) in dict_list:
2452+
for (key,val) in dict_list[::-1]:
24502453
if t == "dictionary":
24512454
# create a unique name
24522455
key = self.get_unique_name(str(key),names)
24532456
names.append(key)
24542457
last = self.add_node(val, node, key)
2458+
# Move it into place
2459+
self._tree.move(last,node,index)
24552460
add_list.append({"type":"add","cell":last})
24562461
self._tree.item(last,open=True)
24572462
first = self.get_root_node() if not len(add_list) else add_list[0].get("cell")
@@ -2655,15 +2660,17 @@ def new_row(self,target=None,force_sibling=False):
26552660
if target == self.get_root_node() and not self.get_check_type(self.get_root_node()).lower() in ("array","dictionary"):
26562661
return # Can't add to a non-collection!
26572662
new_cell = None
2663+
index = 0
26582664
if not self.get_check_type(target).lower() in ("dictionary","array") or force_sibling or (not self._tree.item(target,"open") and len(self._tree.get_children(target))):
2665+
index = self._tree.index(target)+1
26592666
target = self._tree.parent(target)
26602667
target = self.get_root_node() if target == "" else target # Force the Root node if need be
26612668
# create a unique name
26622669
name = ""
26632670
if self.get_check_type(target).lower() == "dictionary":
26642671
names = [self._tree.item(x,"text")for x in self._tree.get_children(target)]
26652672
name = self.get_unique_name("New String",names)
2666-
new_cell = self._tree.insert(target, "end", text=name, values=(self.menu_code + " String","",self.drag_code,))
2673+
new_cell = self._tree.insert(target, index, text=name, values=(self.menu_code + " String","",self.drag_code,))
26672674
# Verify that array names are updated to show the proper indexes
26682675
if self.get_check_type(target).lower() == "array":
26692676
self.update_array_counts(target)

0 commit comments

Comments
 (0)