Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stuart John Watson
mw
Compare revisions
master to clearSubmitLine
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
ripp_/mw
Select target project
No results found
clearSubmitLine
Select Git revision
Swap
Target
milliways/mw
Select target project
elbows/mw
crox/mw
ripp_/mw
milliways/mw
kris/mw
5 results
master
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
clears the last prompt line when text is inputed
· b95031d7
Stuart John Watson
authored
9 years ago
(So fails if enough was typed to wrap it)
b95031d7
Implemented multi line clearing, insure it works on edge case of line full
· 33df71d6
Stuart John Watson
authored
9 years ago
33df71d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/client/main.c
+8
-0
8 additions, 0 deletions
src/client/main.c
with
8 additions
and
0 deletions
src/client/main.c
View file @
33df71d6
...
...
@@ -79,6 +79,7 @@ int saved_history;
int
current_rights
=
0
;
char
clear_line
[]
=
"
\033
[M
\r
"
;
char
up_line
[]
=
"
\033
[1A"
;
static
struct
user
mwuser
;
struct
user
*
const
user
=
&
mwuser
;
...
...
@@ -184,6 +185,13 @@ int disable_rl(int savetext)
static
void
accept_line
(
char
*
line
)
{
int
chars
=
strlen
(
rl_prompt
)
+
rl_end
;
int
lines
=
chars
/
screen_w
()
+
(
chars
%
screen_w
()
!=
0
);
//Divide chars by screen width rounding up
for
(
int
i
=
0
;
i
<
lines
;
i
++
){
write
(
1
,
up_line
,
strlen
(
up_line
));
write
(
1
,
clear_line
,
strlen
(
clear_line
));
}
int
conversion_result
;
if
(
line
==
NULL
)
{
...
...
This diff is collapsed.
Click to expand it.