[gnome-builder] code: remove unused trim whitespace API



commit 92de36818b6151c4d1defe3f134e74dd842c5deb
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 12 21:32:48 2019 -0800

    code: remove unused trim whitespace API

 src/libide/code/ide-buffer.c | 81 --------------------------------------------
 src/libide/code/ide-buffer.h |  2 --
 2 files changed, 83 deletions(-)
---
diff --git a/src/libide/code/ide-buffer.c b/src/libide/code/ide-buffer.c
index 8e22b792d..8e89eb066 100644
--- a/src/libide/code/ide-buffer.c
+++ b/src/libide/code/ide-buffer.c
@@ -3388,87 +3388,6 @@ ide_buffer_get_selection_bounds (IdeBuffer   *self,
     }
 }
 
-/**
- * ide_buffer_trim_trailing_whitespace:
- * @self: an #IdeBuffer
- *
- * Trim trailing whitespaces from the buffer.
- *
- * Only lines that are marked as changed by the underlying buffer
- * monitor will be trimmed. If no #IdeBufferChangeMonitor is present,
- * then all lines will be trimmed.
- *
- * Since: 3.32
- */
-void
-ide_buffer_trim_trailing_whitespace (IdeBuffer *self)
-{
-  GtkTextBuffer *buffer;
-  GtkTextIter iter;
-  gint line;
-
-  g_return_if_fail (IDE_IS_MAIN_THREAD ());
-  g_return_if_fail (IDE_IS_BUFFER (self));
-
-  buffer = GTK_TEXT_BUFFER (self);
-
-  gtk_text_buffer_get_end_iter (buffer, &iter);
-
-  for (line = gtk_text_iter_get_line (&iter); line >= 0; line--)
-    {
-      IdeBufferLineChange change = IDE_BUFFER_LINE_CHANGE_CHANGED;
-
-      if (self->change_monitor)
-        change = ide_buffer_change_monitor_get_change (self->change_monitor, line);
-
-      if (change != IDE_BUFFER_LINE_CHANGE_NONE)
-        {
-          gtk_text_buffer_get_iter_at_line (buffer, &iter, line);
-
-/*
- * Preserve all whitespace that isn't space or tab.
- * This could include line feed, form feed, etc.
- */
-#define TEXT_ITER_IS_SPACE(ptr) \
-  ({  \
-    gunichar ch = gtk_text_iter_get_char (ptr); \
-    (ch == ' ' || ch == '\t'); \
-  })
-
-          /*
-           * Move to the first character at the end of the line (skipping the newline)
-           * and progress to trip if it is white space.
-           */
-          if (gtk_text_iter_forward_to_line_end (&iter) &&
-              !gtk_text_iter_starts_line (&iter) &&
-              gtk_text_iter_backward_char (&iter) &&
-              TEXT_ITER_IS_SPACE (&iter))
-            {
-              GtkTextIter begin = iter;
-
-              gtk_text_iter_forward_to_line_end (&iter);
-
-              while (TEXT_ITER_IS_SPACE (&begin))
-                {
-                  if (gtk_text_iter_starts_line (&begin))
-                    break;
-
-                  if (!gtk_text_iter_backward_char (&begin))
-                    break;
-                }
-
-              if (!TEXT_ITER_IS_SPACE (&begin) && !gtk_text_iter_ends_line (&begin))
-                gtk_text_iter_forward_char (&begin);
-
-              if (!gtk_text_iter_equal (&begin, &iter))
-                gtk_text_buffer_delete (buffer, &begin, &iter);
-            }
-
-#undef TEXT_ITER_IS_SPACE
-        }
-    }
-}
-
 static void
 ide_buffer_get_symbol_resolvers_cb (IdeExtensionSetAdapter *set,
                                     PeasPluginInfo         *plugin_info,
diff --git a/src/libide/code/ide-buffer.h b/src/libide/code/ide-buffer.h
index c6d5ac636..56d9ed5d9 100644
--- a/src/libide/code/ide-buffer.h
+++ b/src/libide/code/ide-buffer.h
@@ -172,7 +172,5 @@ void                    ide_buffer_set_highlight_diagnostics     (IdeBuffer
 IDE_AVAILABLE_IN_3_32
 void                    ide_buffer_set_style_scheme_name         (IdeBuffer               *self,
                                                                   const gchar             
*style_scheme_name);
-IDE_AVAILABLE_IN_3_32
-void                    ide_buffer_trim_trailing_whitespace      (IdeBuffer               *self);
 
 G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]