Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
a9f32a28
Commit
a9f32a28
authored
Mar 20, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Mar 21, 2021
Browse files
Save position when using quick-open
Signed-off-by:
Waqar Ahmed
<
waqar.17a@gmail.com
>
parent
53a21fb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
kate/quickopen/katequickopen.cpp
View file @
a9f32a28
...
...
@@ -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
=
index
.
data
(
Qt
::
UserRole
).
toUrl
();
m_mainWindow
->
wrapper
()
->
openUrl
(
url
);
const
QModelIndex
index
=
m_listView
->
model
()
->
index
(
m_listView
->
currentIndex
().
row
(),
0
);
const
QUrl
url
=
index
.
data
(
Qt
::
UserRole
).
toUrl
();
if
(
!
url
.
isValid
())
{
return
;
}
// 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
);
hide
();
m_mainWindow
->
slotWindowActivated
();
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
);
m_inputLine
->
clear
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment