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
b968f317
Commit
b968f317
authored
Mar 02, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Mar 04, 2021
Browse files
Fixes for buttons enabling / disabling
parent
a5afffd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
kate/katemainwindow.cpp
View file @
b968f317
...
...
@@ -1204,13 +1204,15 @@ void KateMainWindow::addJump(QUrl url, KTextEditor::Cursor c)
// we are in the middle of jumps somewhere?
if
(
!
m_locations
.
isEmpty
()
&&
currentLocation
+
1
<
m_locations
.
size
())
{
// erase all forward history
m_locations
.
remove
(
currentLocation
+
1
,
m_locations
.
size
()
-
(
currentLocation
+
1
));
// this is our new forward
m_locations
.
erase
(
m_locations
.
begin
()
+
currentLocation
+
1
,
m_locations
.
end
());
}
// this is our new forward
m_locations
.
push_back
({
url
,
c
});
// set to last
currentLocation
=
m_locations
.
size
()
-
1
;
// disable forward button as we are at the end now
setForwardButtonEnabled
(
false
);
// renable back
if
(
currentLocation
>
0
)
{
setBackButtonEnabled
(
true
);
...
...
@@ -1283,6 +1285,7 @@ void KateMainWindow::goBack()
if
(
m_locations
.
isEmpty
()
||
currentLocation
==
0
)
{
return
;
}
const
auto
&
location
=
m_locations
.
at
(
currentLocation
-
1
);
currentLocation
--
;
...
...
@@ -1351,6 +1354,8 @@ void KateMainWindow::goForward()
return
;
}
setBackButtonEnabled
(
true
);
auto
v
=
openUrl
(
location
.
url
);
const
QSignalBlocker
blocker
(
v
);
v
->
setCursorPosition
(
location
.
cursor
);
...
...
Write
Preview
Supports
Markdown
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