[gtksourceview/wip/chergert/vim] remove dead code
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] remove dead code
- Date: Wed, 3 Nov 2021 22:39:43 +0000 (UTC)
commit 59118c105395a5184e5e619eba4edd27bdcb3518
Author: Christian Hergert <chergert redhat com>
Date: Wed Nov 3 15:39:38 2021 -0700
remove dead code
gtksourceview/vim/gtk-source-vim-replace.c | 59 ------------------------------
1 file changed, 59 deletions(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-replace.c b/gtksourceview/vim/gtk-source-vim-replace.c
index 956f4cce..4ed52723 100644
--- a/gtksourceview/vim/gtk-source-vim-replace.c
+++ b/gtksourceview/vim/gtk-source-vim-replace.c
@@ -23,7 +23,6 @@
#include <glib/gi18n.h>
-#include "gtk-source-vim-char-pending.h"
#include "gtk-source-vim-replace.h"
#include "gtk-source-vim-insert-literal.h"
@@ -53,42 +52,6 @@ move_to_zero (GtkSourceVimReplace *self)
gtk_text_buffer_select_range (GTK_TEXT_BUFFER (buffer), &insert, &insert);
}
-static void
-gtk_source_vim_replace_selection (GtkTextIter *iter,
- GtkTextIter *end,
- const char *replace)
-{
- GtkTextBuffer *buffer;
- guint offset;
-
- buffer = gtk_text_iter_get_buffer (iter);
-
- gtk_text_iter_order (iter, end);
-
- if (gtk_text_iter_equal (iter, end) &&
- gtk_text_iter_starts_line (iter) &&
- gtk_text_iter_ends_line (iter))
- {
- gtk_text_buffer_insert (buffer, iter, replace, -1);
- return;
- }
-
- offset = gtk_text_iter_get_offset (end);
-
- do
- {
- GtkTextIter here = *iter;
-
- gtk_text_iter_forward_char (iter);
-
- if (!gtk_text_iter_ends_line (&here))
- {
- gtk_text_buffer_delete (buffer, &here, iter);
- gtk_text_buffer_insert (buffer, iter, replace, -1);
- }
- } while (gtk_text_iter_get_offset (iter) < offset);
-}
-
static gboolean
gtk_source_vim_replace_handle_keypress (GtkSourceVimState *state,
guint keyval,
@@ -140,33 +103,11 @@ static void
gtk_source_vim_replace_resume (GtkSourceVimState *state,
GtkSourceVimState *from)
{
- gboolean completed = FALSE;
-
g_assert (GTK_SOURCE_IS_VIM_REPLACE (state));
g_assert (GTK_SOURCE_IS_VIM_STATE (from));
gtk_source_vim_state_set_overwrite (state, TRUE);
-
- if (GTK_SOURCE_IS_VIM_CHAR_PENDING (from))
- {
- const char *string = gtk_source_vim_char_pending_get_string (GTK_SOURCE_VIM_CHAR_PENDING
(from));
-
- if (string != NULL && string[0] != 0)
- {
- GtkTextIter iter, selection;
-
- gtk_source_vim_state_get_buffer (state, &iter, &selection);
- gtk_source_vim_replace_selection (&iter, &selection, string);
- completed = TRUE;
- }
- }
-
gtk_source_vim_state_end_user_action (state);
-
- if (completed == TRUE)
- {
- gtk_source_vim_state_pop (state);
- }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]