diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 3042a60..798fe8e 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -3691,7 +3691,9 @@ gtk_source_view_move_lines (GtkSourceView *view,
 	GtkTextMark *mark;
 	gboolean down;
 	gchar *text;
+	gboolean First_case = 0;
 
+	/* Will be considered the firts especial case for a special case of this when there are only two lines */
 	buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
 
 	if (step == 0 || !gtk_text_view_get_editable (GTK_TEXT_VIEW (view)))
@@ -3721,6 +3723,7 @@ gtk_source_view_move_lines (GtkSourceView *view,
 	}
 
 	text = gtk_text_buffer_get_slice (buf, &s, &e, TRUE);
+	gtk_text_buffer_begin_user_action (buf);
 
 	/* First special case) We are moving up the last line
 	 * of the buffer, check if buffer ends with a paragraph
@@ -3737,19 +3740,17 @@ gtk_source_view_move_lines (GtkSourceView *view,
 			gchar *tmp;
 
 			tmp = g_strdup_printf ("%s\n", text);
-
 			g_free (text);
 			text = tmp;
+			First_case = 1;
 		}
 	}
 
-	gtk_text_buffer_begin_user_action (buf);
-
 	if (!copy)
 	{
 		gtk_text_buffer_delete (buf, &s, &e);
 	}
-
+	/*iter_save_e and iter_back_char; aux var iter for clean "/n" from  buffer*/
 	if (down)
 	{
 		gtk_text_iter_forward_line (&e);
@@ -3760,6 +3761,8 @@ gtk_source_view_move_lines (GtkSourceView *view,
 		if (gtk_text_iter_is_end (&e))
 		{
 			GtkTextIter iter;
+			GtkTextIter iter_save_e;
+			GtkTextIter iter_back_char;
 			iter = e;
 
 			gtk_text_iter_set_line_offset (&iter, 0);
@@ -3767,12 +3770,49 @@ gtk_source_view_move_lines (GtkSourceView *view,
 			    !gtk_text_iter_forward_to_line_end (&iter))
 			{
 				gtk_text_buffer_insert (buf, &e, "\n", -1);
+				iter_save_e = e;
+
+				gtk_text_buffer_insert (buf, &e, text, -1);
+				g_free (text);
+				gtk_text_iter_forward_to_end (&e);
+				iter_back_char = e;
+
+				gtk_text_iter_backward_char (&iter_back_char);
+				gtk_text_buffer_delete (buf, &iter_back_char, &e);
+				text = gtk_text_buffer_get_slice (buf, &iter_save_e, &iter_back_char, TRUE);
+				gtk_text_buffer_delete (buf, &iter_save_e, &e);
 			}
 		}
 	}
+	/* Line zero) when exists only two lines the cursor need go back to first line and the iterator get this value*/
 	else
 	{
 		gtk_text_iter_backward_line (&e);
+		if( First_case )
+		{
+				GtkTextIter iter_end;
+				gboolean Line_zero = 0;
+
+				gtk_text_iter_forward_line (&e);
+
+				if(gtk_text_iter_backward_line (&e))
+					if(gtk_text_iter_backward_line(&e));
+				else
+					Line_zero =1;
+
+				gtk_text_iter_forward_line (&e);
+				gtk_text_iter_forward_line (&e);
+
+				iter_end = e;
+
+				gtk_text_iter_backward_char (&e);
+				gtk_text_buffer_delete (buf, &e, &iter_end);
+				gtk_text_iter_backward_line (&e);
+				gtk_text_iter_forward_line (&e);
+
+				if(Line_zero)
+					gtk_text_iter_backward_line(&e);
+		}
 	}
 
 	/* use anon mark to be able to select after insertion */
@@ -3792,7 +3832,6 @@ gtk_source_view_move_lines (GtkSourceView *view,
 
 	gtk_text_buffer_delete_mark (buf, mark);
 }
-
 static gboolean
 do_smart_backspace (GtkSourceView *view)
 {
