Skip to content

Commit

Permalink
Fix swap outs && add linux and windows keymap test-swap
Browse files Browse the repository at this point in the history
  • Loading branch information
Jatana committed Sep 15, 2018
1 parent 13de8e2 commit 74c88bf
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,42 @@
]
},

// Swap Test
{
"keys": ["ctrl+shift+up"],
"command": "test_manager",
"args": {
"action": "swap_tests",
"dir": -1
},
"context": [
{
"operand": "source.TestSyntax",
"operator": "equal",
"match_all": true,
"key": "selector"
}
]
},

// Swap Test
{
"keys": ["ctrl+shift+down"],
"command": "test_manager",
"args": {
"action": "swap_tests",
"dir": 1
},
"context": [
{
"operand": "source.TestSyntax",
"operator": "equal",
"match_all": true,
"key": "selector"
}
]
},

// Run
{
"keys": ["ctrl+alt+b"],
Expand Down
36 changes: 36 additions & 0 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,42 @@
]
},

// Swap Test
{
"keys": ["ctrl+shift+up"],
"command": "test_manager",
"args": {
"action": "swap_tests",
"dir": -1
},
"context": [
{
"operand": "source.TestSyntax",
"operator": "equal",
"match_all": true,
"key": "selector"
}
]
},

// Swap Test
{
"keys": ["ctrl+shift+down"],
"command": "test_manager",
"args": {
"action": "swap_tests",
"dir": 1
},
"context": [
{
"operand": "source.TestSyntax",
"operator": "equal",
"match_all": true,
"key": "selector"
}
]
},

// Run
{
"keys": ["ctrl+alt+b"],
Expand Down
1 change: 1 addition & 0 deletions test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,7 @@ def swap_tests(self, edit, dir=-1):
for sel in selected:
if 0 <= sel + dir < len(tester.tests):
tester.tests[sel], tester.tests[sel + dir] = tester.tests[sel + dir], tester.tests[sel]
tester.prog_out[sel], tester.prog_out[sel + dir] = tester.prog_out[sel + dir], tester.prog_out[sel]

for i in range(len(tester.tests)):
if tester.tests[i].__unfold:
Expand Down

0 comments on commit 74c88bf

Please sign in to comment.