Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Linenoise
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
phoenix
public
Linenoise
Commits
2eb49568
Commit
2eb49568
authored
9 years ago
by
antirez
Browse files
Options
Downloads
Patches
Plain Diff
Clear hints after newline.
parent
a64257a8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
linenoise.c
+8
-0
8 additions, 0 deletions
linenoise.c
linenoise.h
+1
-1
1 addition, 1 deletion
linenoise.h
with
9 additions
and
1 deletion
linenoise.c
+
8
−
0
View file @
2eb49568
...
...
@@ -815,6 +815,14 @@ static int linenoiseEdit(int stdin_fd, int stdout_fd, char *buf, size_t buflen,
history_len
--
;
free
(
history
[
history_len
]);
if
(
mlmode
)
linenoiseEditMoveEnd
(
&
l
);
if
(
hintsCallback
)
{
/* Force a refresh without hints to leave the previous
* line as the user typed it after a newline. */
linenoiseHintsCallback
*
hc
=
hintsCallback
;
hintsCallback
=
NULL
;
refreshLine
(
&
l
);
hintsCallback
=
hc
;
}
return
(
int
)
l
.
len
;
case
CTRL_C
:
/* ctrl-c */
errno
=
EAGAIN
;
...
...
This diff is collapsed.
Click to expand it.
linenoise.h
+
1
−
1
View file @
2eb49568
...
...
@@ -50,7 +50,7 @@ typedef struct linenoiseCompletions {
typedef
void
(
linenoiseCompletionCallback
)(
const
char
*
,
linenoiseCompletions
*
);
typedef
char
*
(
linenoiseHintsCallback
)(
const
char
*
,
int
*
color
,
int
*
bold
);
typedef
char
*
(
linenoiseFreeHintsCallback
)(
char
*
);
typedef
void
(
linenoiseFreeHintsCallback
)(
void
*
);
void
linenoiseSetCompletionCallback
(
linenoiseCompletionCallback
*
);
void
linenoiseSetHintsCallback
(
linenoiseHintsCallback
*
);
void
linenoiseSetFreeHintsCallback
(
linenoiseFreeHintsCallback
*
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment