Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
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
Container registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
5b4d99b5
Commit
5b4d99b5
authored
25 years ago
by
Marcus Comstedt
Browse files
Options
Downloads
Patches
Plain Diff
New function edit() that allows a default string to be put on the edit line.
Rev: lib/modules/Stdio.pmod/Readline.pike:1.19
parent
ab8790b5
No related branches found
No related tags found
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Stdio.pmod/Readline.pike
+9
-3
9 additions, 3 deletions
lib/modules/Stdio.pmod/Readline.pike
with
9 additions
and
3 deletions
lib/modules/Stdio.pmod/Readline.pike
+
9
−
3
View file @
5b4d99b5
// $Id: Readline.pike,v 1.1
8
1999/06/0
6 09:05:48 mirar
Exp $
// $Id: Readline.pike,v 1.1
9
1999/06/0
9 16:23:31 marcus
Exp $
class OutputController
{
...
...
@@ -1246,21 +1246,27 @@ void set_blocking()
set_nonblocking(0);
}
string
read(
)
string
edit(string data, string|void local_prompt
)
{
if(newline_func == read_newline)
return 0;
function oldnl = newline_func;
output_controller->write(prompt);
output_controller->write(
local_prompt||
prompt);
initline();
newline_func = read_newline;
readtext = "";
output_controller->enable();
insert(data, 0);
int res = input_controller->run_blocking();
set_nonblocking(oldnl);
return (res>=0 || sizeof(readtext)) && readtext;
}
string read(string|void prompt)
{
return edit("", prompt);
}
void enable_history(object(History)|int hist)
{
if (objectp(hist))
...
...
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