Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions plugins/markdown-actions/markdown-actions.vala
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ public class Code.Plugins.MarkdownActions : Peas.ExtensionBase, Scratch.Services
var line = get_current_line (next).strip ();
// Get list item number from current line
parse_ordered_list_item (line, ref count, out item_text);
// Start checking following lines
next.forward_line ();
line = get_current_line (next).strip ();
while (parse_ordered_list_item (line, ref count, out item_text)) {
while (
next.forward_line () &&
parse_ordered_list_item (get_current_line (next).strip (), ref count, out item_text)
) {
count++;
var next_mark = current_buffer.create_mark (null, next, true);
var point_offset = line.index_of_char ('.');
Expand All @@ -139,8 +139,6 @@ public class Code.Plugins.MarkdownActions : Peas.ExtensionBase, Scratch.Services

var to_insert = "%d".printf (count);
current_buffer.insert (ref next, to_insert, to_insert.length);
next.forward_line ();
line = get_current_line (next).strip ();
}
}

Expand Down