@@ -589,6 +589,7 @@ def get_mod_bitmask(self):
589
589
bit_mask -= 0x2 # Caps Lock
590
590
# bit_mask -= 0x4 # Ctrl, don't whitelist - used for keybinds
591
591
bit_mask -= 0x8 # Num Lock
592
+ bit_mask -= 0x20 # Scroll Lock
592
593
# bit_mask -= 0x20000 # Alt, don't whitelist - used for File keybinds
593
594
elif sys .platform == "darwin" : # macOS
594
595
bit_mask -= 0x1 # Shift
@@ -2418,7 +2419,9 @@ def paste_selection(self, event = None):
2418
2419
node = "" if not len (self ._tree .selection ()) else self ._tree .selection ()[0 ]
2419
2420
# Verify the type - or get the parent
2420
2421
t = self .get_check_type (node ).lower ()
2422
+ index = 0
2421
2423
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
2422
2425
node = self ._tree .parent (node )
2423
2426
node = self .get_root_node () if node == "" else node # Force Root node if need be
2424
2427
t = self .get_check_type (node ).lower ()
@@ -2446,12 +2449,14 @@ def paste_selection(self, event = None):
2446
2449
if isinstance (plist_data ,dict ):
2447
2450
dict_list = list (plist_data .items ()) if not self .controller .settings .get ("sort_dict" ,False ) else sorted (list (plist_data .items ()))
2448
2451
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 ] :
2450
2453
if t == "dictionary" :
2451
2454
# create a unique name
2452
2455
key = self .get_unique_name (str (key ),names )
2453
2456
names .append (key )
2454
2457
last = self .add_node (val , node , key )
2458
+ # Move it into place
2459
+ self ._tree .move (last ,node ,index )
2455
2460
add_list .append ({"type" :"add" ,"cell" :last })
2456
2461
self ._tree .item (last ,open = True )
2457
2462
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):
2655
2660
if target == self .get_root_node () and not self .get_check_type (self .get_root_node ()).lower () in ("array" ,"dictionary" ):
2656
2661
return # Can't add to a non-collection!
2657
2662
new_cell = None
2663
+ index = 0
2658
2664
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
2659
2666
target = self ._tree .parent (target )
2660
2667
target = self .get_root_node () if target == "" else target # Force the Root node if need be
2661
2668
# create a unique name
2662
2669
name = ""
2663
2670
if self .get_check_type (target ).lower () == "dictionary" :
2664
2671
names = [self ._tree .item (x ,"text" )for x in self ._tree .get_children (target )]
2665
2672
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 ,))
2667
2674
# Verify that array names are updated to show the proper indexes
2668
2675
if self .get_check_type (target ).lower () == "array" :
2669
2676
self .update_array_counts (target )
0 commit comments