From e337060dad246b8fc5841c658cfbf86e22307b4e Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 10 Feb 2015 01:18:48 +0100 Subject: Improve codemirror markers --- monkey/monkey.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/monkey/monkey.py b/monkey/monkey.py index 7155c23..c037193 100755 --- a/monkey/monkey.py +++ b/monkey/monkey.py @@ -181,9 +181,17 @@ def fix_ranges(edits): marks = [] for step_type, line, (before, after) in edits: if step_type == 'change_line': - marks.append(('change', (before[0].pos, before[-1].pos+len(before[-1].val)))) + marks.append({ 'start': before[0].pos, + 'end': before[-1].pos+len(before[-1].val), + 'msg': 'Change this line.' }) elif step_type == 'remove_line': - marks.append(('remove', (before[0].pos, before[-1].pos+len(before[-1].val)))) - elif step_type == 'add_subgoal' or step_type == 'add_rule': - marks.append((step_type, line)) + marks.append({ 'start': before[0].pos, + 'end': before[-1].pos+len(before[-1].val), + 'msg': 'Remove this line.' }) + elif step_type == 'add_subgoal': + marks.append({ 'msg': 'Add a new subgoal', + 'line': line }); + elif step_type == 'add_rule': + marks.append({ 'msg': 'Add a new rule', + 'line': line }); return marks -- cgit v1.2.1