Skip to content

Commit 3a2e531

Browse files
committed
Add xmpfilter keybindings, use --shebang args (not released yet, current version is 2.0.0.beta2)
1 parent 7864c2b commit 3a2e531

5 files changed

+63
-8
lines changed

Default (Linux).sublime-keymap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
]
1414
},
1515

16+
{
17+
"keys": ["ctrl+alt+n"],
18+
"command":"i_drank_poison_for_you",
19+
"context":
20+
[
21+
// if selector == source.ruby for all selections
22+
{ "key": "selector",
23+
"operator": "equal",
24+
"operand": "source.ruby",
25+
"match_all": true }
26+
]
27+
},
28+
1629
{
1730
"keys": ["ctrl+alt+v"],
1831
"command":"every_time_someone_says_iDo_not_believe_in_fairies_somewhere_theres_aFairy_that_falls_down_dead",

Default (OSX).sublime-keymap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
]
1414
},
1515

16+
{
17+
"keys": ["super+alt+n"],
18+
"command":"i_drank_poison_for_you",
19+
"context":
20+
[
21+
// if selector == source.ruby for all selections
22+
{ "key": "selector",
23+
"operator": "equal",
24+
"operand": "source.ruby",
25+
"match_all": true }
26+
]
27+
},
28+
1629
{
1730
"keys": ["super+alt+v"],
1831
"command":"every_time_someone_says_iDo_not_believe_in_fairies_somewhere_theres_aFairy_that_falls_down_dead",

Default (Windows).sublime-keymap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[
22
{
3+
// b is for believer!
34
"keys": ["ctrl+alt+b"],
45
"command":"you_know_that_place_between_sleep_and_awake_that_place_where_you_still_remember_dreaming_thats_where_ill_always_love_you",
56
"context":
@@ -12,6 +13,19 @@
1213
]
1314
},
1415

16+
{
17+
"keys": ["ctrl+alt+n"],
18+
"command":"i_drank_poison_for_you",
19+
"context":
20+
[
21+
// if selector == source.ruby for all selections
22+
{ "key": "selector",
23+
"operator": "equal",
24+
"operand": "source.ruby",
25+
"match_all": true }
26+
]
27+
},
28+
1529
{
1630
// b is for believer!
1731
"keys": ["ctrl+alt+v"],

Seeing Is Believing.sublime-commands

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"command": "you_know_that_place_between_sleep_and_awake_that_place_where_you_still_remember_dreaming_thats_where_ill_always_love_you"
55
},
66

7+
{
8+
"caption": "Seeing Is Believing: Evaluate Marked Lines",
9+
"command": "i_drank_poison_for_you"
10+
},
11+
712
{
813
"caption": "Seeing Is Believing: Remove Annotations",
914
"command": "every_time_someone_says_iDo_not_believe_in_fairies_somewhere_theres_aFairy_that_falls_down_dead"

seeing_is_believing.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ def run(self, edit):
2121

2222
# set up the args
2323
args = []
24-
args.append(os.path.expanduser(settings.get("ruby_command")))
24+
ruby_command = os.path.expanduser(settings.get("ruby_command"))
25+
args.append(ruby_command)
2526
args.append('-S')
2627
args.append('seeing_is_believing')
28+
args.append('--shebang')
29+
args.append(ruby_command)
30+
if self.view.file_name() != None:
31+
args.append("--as")
32+
args.append(self.view.file_name())
2733

2834
# subclass defines this
2935
self.setup_flags(args, settings)
@@ -50,19 +56,23 @@ def setup_flags(self, args, settings):
5056
for (name, value) in settings.get("flags").iteritems():
5157
args.append(str(name))
5258
args.append(str(value))
53-
if self.view.file_name() != None:
54-
args.append("--as")
55-
args.append(self.view.file_name())
59+
60+
def should_display_stderr(self, returncode):
61+
return returncode != None and returncode != 0 and returncode != 1
62+
63+
class IDrankPoisonForYou(SeeingIsBelieving):
64+
def setup_flags(self, args, settings):
65+
args.append('--xmpfilter-style')
66+
for (name, value) in settings.get("flags").iteritems():
67+
args.append(str(name))
68+
args.append(str(value))
5669

5770
def should_display_stderr(self, returncode):
5871
return returncode != None and returncode != 0 and returncode != 1
5972

6073
class EveryTimeSomeoneSaysIDoNotBelieveInFairiesSomewhereTheresAFairyThatFallsDownDead(SeeingIsBelieving):
6174
def setup_flags(self, args, settings):
6275
args.append('--clean')
63-
if self.view.file_name() != None:
64-
args.append("--as")
65-
args.append(self.view.file_name())
6676

6777
def should_display_stderr(self, returncode):
68-
return returncode != None and returncode != 0
78+
return returncode != None and returncode != 0

0 commit comments

Comments
 (0)