Browse Source

No longer copies indentation when copying within one line

merge-requests/413/head
eidheim 3 years ago
parent
commit
d11946c75c
  1. 2
      src/source_base.cpp

2
src/source_base.cpp

@ -310,6 +310,8 @@ void Source::CommonView::copy_lines() {
bool Source::CommonView::copy_with_first_line_indentation() { bool Source::CommonView::copy_with_first_line_indentation() {
Gtk::TextIter start, end; Gtk::TextIter start, end;
get_buffer()->get_selection_bounds(start, end); get_buffer()->get_selection_bounds(start, end);
if(start.get_line() == end.get_line())
return false;
auto line_start = start; auto line_start = start;
while(!line_start.starts_line() && line_start.backward_char() && (*line_start == ' ' || *line_start == '\t')) { while(!line_start.starts_line() && line_start.backward_char() && (*line_start == ' ' || *line_start == '\t')) {

Loading…
Cancel
Save