| Summary: | deleting a line while selecting the last chars of a file deletes the complete content of the file | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Till Schäfer <till2.schaefer> |
| Component: | part | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | michal.humpula |
| Priority: | NOR | ||
| Version First Reported In: | 3.13.0 | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | http://commits.kde.org/ktexteditor/af907b0faf9dcccf0e981d4a17eedaed7d414e77 | Version Fixed In: | |
| Sentry Crash Report: | |||
|
Description
Till Schäfer
2014-03-25 18:07:07 UTC
@Michal: May it be, that we should cache the end line? i.e.:
void KateView::killLine( )
{
if (m_selection.isEmpty()) {
m_doc->removeLine(cursorPosition().line());
} else {
m_doc->editStart();
- for (int line = m_selection.end().line(); line >= m_selection.start().line(); line--) {
+ const int startLine = m_selection.start().line();
+ for (int line = m_selection.range.end().line(); line >= startLine; line--) {
m_doc->removeLine(line);
}
m_doc->editEnd();
}
}
Git commit af907b0faf9dcccf0e981d4a17eedaed7d414e77 by Christoph Cullmann. Committed on 23/09/2014 at 18:51. Pushed by cullmann into branch 'master'. fix kill line with selection if last line is selected good catch Dominik, the endLine is altered and we delete everything! M +2 -1 src/view/kateview.cpp http://commits.kde.org/ktexteditor/af907b0faf9dcccf0e981d4a17eedaed7d414e77 |