Branch: refs/heads/master Author: Sylvan Mostert smostert.dev@gmail.com Committer: Sylvan Mostert smostert.dev@gmail.com Date: Sun, 17 Jan 2016 17:49:00 UTC Commit: 115fdb2d2a6791b953a7cbe0f1062526d8385e47 https://github.com/geany/geany-plugins/commit/115fdb2d2a6791b953a7cbe0f10625...
Log Message: ----------- lineoperations: general formatting/cleanup
Removed trailing spaces, and changed all indents to tabs.
Modified Paths: -------------- Makefile.am lineoperations/src/linefunctions.c lineoperations/src/lineoperations.c
Modified: Makefile.am 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -110,6 +110,7 @@ endif if ENABLE_LINEOPERATIONS SUBDIRS += lineoperations endif + if ENABLE_MARKDOWN SUBDIRS += markdown endif
Modified: lineoperations/src/linefunctions.c 37 lines changed, 18 insertions(+), 19 deletions(-) =================================================================== @@ -36,6 +36,7 @@ static void ensure_final_newline(GeanyEditor *editor, gint max_lines) } }
+ /* comparison function to be used in qsort */ static gint compare_asc(const void * a, const void * b) { @@ -88,7 +89,7 @@ void rmdupst(GeanyDocument *doc) { nf_end = g_stpcpy(nf_end, lines[i]); }
- /* set new document */ + /* set new document */ sci_set_text(doc->editor->sci, new_file);
/* free used memory */ @@ -146,7 +147,7 @@ void rmdupln(GeanyDocument *doc) { if(!to_remove[i]) nf_end = g_stpcpy(nf_end, lines[i]);
- /* set new document */ + /* set new document */ sci_set_text(doc->editor->sci, new_file);
/* free used memory */ @@ -208,7 +209,7 @@ void rmunqln(GeanyDocument *doc) { if(!to_remove[i]) nf_end = g_stpcpy(nf_end, lines[i]);
- /* set new document */ + /* set new document */ sci_set_text(doc->editor->sci, new_file);
/* free used memory */ @@ -235,9 +236,9 @@ void rmemtyln(GeanyDocument *doc) { sci_get_line_end_position(doc->editor->sci, i)) { scintilla_send_message(doc->editor->sci, - SCI_DELETERANGE, - sci_get_position_from_line(doc->editor->sci, i), - sci_get_line_length(doc->editor->sci, i)); + SCI_DELETERANGE, + sci_get_position_from_line(doc->editor->sci, i), + sci_get_line_length(doc->editor->sci, i)); total_num_lines--; i--; } @@ -247,8 +248,6 @@ void rmemtyln(GeanyDocument *doc) { }
- - /* Remove Whitespace Lines */ void rmwhspln(GeanyDocument *doc) { gint total_num_lines; /* number of lines in the document */ @@ -256,24 +255,24 @@ void rmwhspln(GeanyDocument *doc) { gint i; /* iterator */
total_num_lines = sci_get_line_count(doc->editor->sci); - + sci_start_undo_action(doc->editor->sci);
for(i = 0; i < total_num_lines; i++) /* loop through opened doc */ { indent = scintilla_send_message(doc->editor->sci, - SCI_GETLINEINDENTPOSITION, - i, 0); + SCI_GETLINEINDENTPOSITION, + i, 0);
if(indent - - sci_get_position_from_line(doc->editor->sci, i) == - sci_get_line_end_position(doc->editor->sci, i)- - sci_get_position_from_line(doc->editor->sci, i)) + sci_get_position_from_line(doc->editor->sci, i) == + sci_get_line_end_position(doc->editor->sci, i)- + sci_get_position_from_line(doc->editor->sci, i)) { scintilla_send_message(doc->editor->sci, - SCI_DELETERANGE, - sci_get_position_from_line(doc->editor->sci, i), - sci_get_line_length(doc->editor->sci, i)); + SCI_DELETERANGE, + sci_get_position_from_line(doc->editor->sci, i), + sci_get_line_length(doc->editor->sci, i)); total_num_lines--; i--; } @@ -316,8 +315,8 @@ void sortlines(GeanyDocument *doc, gboolean asc) { /* join **lines into one string (new_file) */ lines[total_num_lines] = NULL; new_file = g_strjoinv("", lines); - - /* set new document */ + + /* set new document */ sci_set_text(doc->editor->sci, new_file);
/* free used memory */
Modified: lineoperations/src/lineoperations.c 14 lines changed, 7 insertions(+), 7 deletions(-) =================================================================== @@ -122,13 +122,13 @@ void geany_load_module(GeanyPlugin *plugin) { main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
- plugin->info->name = _("Line Operations"); - plugin->info->description = _("Line Operations provides a handful of functions that can be applied to a document such as, removing duplicate lines, removing empty lines, removing lines with only whitespace, and sorting lines."); - plugin->info->version = "0.1"; - plugin->info->author = _("Sylvan Mostert smostert.dev@gmail.com"); + plugin->info->name = _("Line Operations"); + plugin->info->description = _("Line Operations provides a handful of functions that can be applied to a document such as, removing duplicate lines, removing empty lines, removing lines with only whitespace, and sorting lines."); + plugin->info->version = "0.1"; + plugin->info->author = _("Sylvan Mostert smostert.dev@gmail.com");
- plugin->funcs->init = lo_init; - plugin->funcs->cleanup = lo_cleanup; + plugin->funcs->init = lo_init; + plugin->funcs->cleanup = lo_cleanup;
- GEANY_PLUGIN_REGISTER(plugin, 225); + GEANY_PLUGIN_REGISTER(plugin, 225); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org