b4n commented on this pull request.
Looks good apart from the unnecessary allocations.
Also, I'm find with depending on @techee's PR, so you can drop the first commit if you want.
gint num_chars = 0;
gint i = 0; gint lines_affected = 0;
+ struct lo_lines *sel = g_malloc(sizeof(struct lo_lines));
instead of allocating on the heap you could pass `&sel` to the `get_current_sel_lines()` call below
@@ -223,18 +227,26 @@ action_sci_manip_item(GtkMenuItem *menuitem, gpointer gdata)
/* function pointer to gdata -- function to be used */ gint (*func)(ScintillaObject *, gint, gint) = gdata; GeanyDocument *doc = document_get_current(); - struct lo_lines sel = get_current_sel_lines(doc->editor->sci); + + struct lo_lines *sel = g_malloc(sizeof(struct lo_lines));
ditto