Commit 175a6a1c authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Save position when using quick-open

Signed-off-by: Waqar Ahmed's avatarWaqar Ahmed <>
parent cc7cf429
......@@ -341,12 +341,29 @@ void KateQuickOpen::update(KateMainWindow *mainWindow)
void KateQuickOpen::slotReturnPressed()
const auto index = m_listView->model()->index(m_listView->currentIndex().row(), 0);
auto url =;
const QModelIndex index = m_listView->model()->index(m_listView->currentIndex().row(), 0);
const QUrl url =;
if (!url.isValid()) {
// save current position before opening new url for location history
KateViewManager *vm = m_mainWindow->viewManager();
if (vm) {
if (KTextEditor::View *v = vm->activeView()) {
vm->savePosition(v->document()->url(), v->cursorPosition());
KTextEditor::View *v = m_mainWindow->wrapper()->openUrl(url);
if (v) {
vm->savePosition(v->document()->url(), v->cursorPosition());
// block signals for input line so that we dont trigger filtering again
const QSignalBlocker blocker(m_inputLine);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment