Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
2f899769
Commit
2f899769
authored
Nov 05, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CoWowRecall should push to the tmp buffer, not the main recall buffer on key up.
parent
d4494930
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
xtt/lib/cow/src/cow_wow.cpp
xtt/lib/cow/src/cow_wow.cpp
+16
-5
xtt/lib/cow/src/cow_wow.h
xtt/lib/cow/src/cow_wow.h
+1
-0
No files found.
xtt/lib/cow/src/cow_wow.cpp
View file @
2f899769
...
...
@@ -62,7 +62,7 @@ void CoWowTimer::remove()
{
}
CoWowRecall
::
CoWowRecall
()
:
m_current_recall_line
(
0
),
m_current_size
(
0
)
CoWowRecall
::
CoWowRecall
()
:
m_current_recall_line
(
0
),
m_current_size
(
0
)
,
m_tmp_size
(
0
)
{
memset
(
m_recall
,
0
,
sizeof
(
m_recall
));
}
...
...
@@ -87,22 +87,33 @@ void CoWowRecall::push(const char* src)
void
CoWowRecall
::
resetTmp
()
{
for
(
int
i
=
0
;
i
<
m_
current
_size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
m_
recall
_size
;
i
++
)
{
strcpy
(
tmp
[
i
],
m_recall
[
i
]);
}
m_current_recall_line
=
0
;
m_tmp_size
=
m_current_size
;
}
const
char
*
CoWowRecall
::
popUp
(
const
char
*
src
)
{
if
(
m_current_recall_line
==
0
&&
!
streq
(
src
,
tmp
[
0
]))
{
push
(
src
);
if
(
m_tmp_size
==
0
||
!
streq
(
tmp
[
0
],
""
))
{
for
(
int
i
=
m_recall_size
-
2
;
i
>=
0
;
i
--
)
{
strcpy
(
tmp
[
i
+
1
],
tmp
[
i
]);
}
m_tmp_size
++
;
if
(
m_tmp_size
>
m_recall_size
)
{
m_tmp_size
=
m_recall_size
;
}
}
strncpy
(
tmp
[
0
],
src
,
m_line_size
);
tmp
[
0
][
m_line_size
-
1
]
=
0
;
}
else
{
strncpy
(
tmp
[
m_current_recall_line
],
src
,
m_line_size
);
}
m_current_recall_line
++
;
if
(
m_current_recall_line
>
m_
current
_size
-
1
)
{
m_current_recall_line
=
m_
current
_size
-
1
;
if
(
m_current_recall_line
>
m_
tmp
_size
-
1
)
{
m_current_recall_line
=
m_
tmp
_size
-
1
;
}
return
tmp
[
m_current_recall_line
];
}
...
...
xtt/lib/cow/src/cow_wow.h
View file @
2f899769
...
...
@@ -93,6 +93,7 @@ public:
char
m_recall
[
m_recall_size
][
m_line_size
];
int
m_current_recall_line
;
int
m_current_size
;
int
m_tmp_size
;
char
tmp
[
m_recall_size
][
m_line_size
];
void
push
(
const
char
*
src
);
...
...
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