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
f1a690d2
Commit
f1a690d2
authored
Mar 18, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Mar 21, 2021
Browse files
Dont record locations resulting from typing text
Signed-off-by:
Waqar Ahmed
<
waqar.17a@gmail.com
>
parent
84293c75
Changes
2
Hide whitespace changes
Inline
Side-by-side
kate/kateviewspace.cpp
View file @
f1a690d2
...
@@ -216,6 +216,12 @@ KTextEditor::View *KateViewSpace::createView(KTextEditor::Document *doc)
...
@@ -216,6 +216,12 @@ KTextEditor::View *KateViewSpace::createView(KTextEditor::Document *doc)
addJump
(
view
->
document
()
->
url
(),
newPosition
);
addJump
(
view
->
document
()
->
url
(),
newPosition
);
});
});
connect
(
v
,
&
KTextEditor
::
View
::
textInserted
,
this
,
[
this
](
KTextEditor
::
View
*
view
,
const
KTextEditor
::
Cursor
&
,
const
QString
&
)
{
if
(
view
)
{
m_textWasInserted
=
true
;
}
});
// register document, it is shown below through showView() then
// register document, it is shown below through showView() then
registerDocument
(
doc
);
registerDocument
(
doc
);
...
@@ -476,6 +482,12 @@ void KateViewSpace::focusNextTab()
...
@@ -476,6 +482,12 @@ void KateViewSpace::focusNextTab()
void
KateViewSpace
::
addJump
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
)
void
KateViewSpace
::
addJump
(
const
QUrl
&
url
,
KTextEditor
::
Cursor
c
)
{
{
// are we typing text? => no jump record
if
(
m_textWasInserted
)
{
m_textWasInserted
=
false
;
return
;
}
// we are in the middle of jumps somewhere?
// we are in the middle of jumps somewhere?
if
(
!
m_locations
.
isEmpty
()
&&
currentLocation
+
1
<
m_locations
.
size
())
{
if
(
!
m_locations
.
isEmpty
()
&&
currentLocation
+
1
<
m_locations
.
size
())
{
// erase all forward history
// erase all forward history
...
...
kate/kateviewspace.h
View file @
f1a690d2
...
@@ -183,6 +183,7 @@ private:
...
@@ -183,6 +183,7 @@ private:
QVector
<
Location
>
m_locations
;
QVector
<
Location
>
m_locations
;
int
currentLocation
=
0
;
int
currentLocation
=
0
;
bool
m_textWasInserted
=
false
;
/**
/**
* all documents this view space is aware of
* all documents this view space is aware of
...
...
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