Branch: refs/heads/master Author: Sylvan Mostert smostert.dev@gmail.com Committer: Sylvan Mostert smostert.dev@gmail.com Date: Sun, 17 Jan 2016 04:05:36 UTC Commit: 2c2cface2512bbc57ffa615e24fce75782fd5a34 https://github.com/geany/geany-plugins/commit/2c2cface2512bbc57ffa615e24fce7...
Log Message: ----------- lineoperations: switched functions in rmwhspln()
Switched `sci_get_line_indentation()` to `SCI_GETLINEINDENTPOSITION`.
Modified Paths: -------------- lineoperations/src/linefunctions.c
Modified: lineoperations/src/linefunctions.c 16 lines changed, 11 insertions(+), 5 deletions(-) =================================================================== @@ -252,18 +252,23 @@ void rmemtyln(GeanyDocument *doc) { /* Remove Whitespace Lines */ void rmwhspln(GeanyDocument *doc) { gint total_num_lines; /* number of lines in the document */ + gint indent; 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 */ { - - if(sci_get_line_end_position(doc->editor->sci, i) - - sci_get_position_from_line(doc->editor->sci, i) == - sci_get_line_indentation(doc->editor->sci, i)) + indent = scintilla_send_message(doc->editor->sci, + 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)) { scintilla_send_message(doc->editor->sci, SCI_DELETERANGE, @@ -275,6 +280,7 @@ void rmwhspln(GeanyDocument *doc) {
}
+ sci_end_undo_action(doc->editor->sci); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org