From d11946c75cbbcecfc16c80de694b8e2e266a3fd9 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sat, 10 Dec 2022 15:13:29 +0100 Subject: [PATCH] No longer copies indentation when copying within one line --- src/source_base.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/source_base.cpp b/src/source_base.cpp index 4d81863..d6dc5ad 100644 --- a/src/source_base.cpp +++ b/src/source_base.cpp @@ -310,6 +310,8 @@ void Source::CommonView::copy_lines() { bool Source::CommonView::copy_with_first_line_indentation() { Gtk::TextIter start, end; get_buffer()->get_selection_bounds(start, end); + if(start.get_line() == end.get_line()) + return false; auto line_start = start; while(!line_start.starts_line() && line_start.backward_char() && (*line_start == ' ' || *line_start == '\t')) {