From 717d100a4657927592d0ccfc16c8cd33f80c0609 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Thu, 7 Mar 2013 11:03:16 +0100 Subject: [PATCH] Don't reset selected row on delete. --- NJMappingsController.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NJMappingsController.m b/NJMappingsController.m index 0adb1f9..2063d24 100644 --- a/NJMappingsController.m +++ b/NJMappingsController.m @@ -116,8 +116,9 @@ if (tableView.selectedRow == 0) return; - [_mappings removeObjectAtIndex:tableView.selectedRow]; - [self activateMapping:_mappings[0]]; + NSInteger selectedRow = tableView.selectedRow; + [_mappings removeObjectAtIndex:selectedRow]; + [self activateMapping:_mappings[MIN(selectedRow, _mappings.count - 1)]]; [self mappingsChanged]; } -- 2.30.2