bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Selecting item from history by position and displaying for editing...


From: Sam Habiel
Subject: Selecting item from history by position and displaying for editing...
Date: Tue, 25 Jul 2023 12:19:16 -0400
User-agent: Zoho Mail

Hello there,

Quick Intro: We have an interactive CLI for a language called M used in banking 
and healthcare... I am working on adding readline integration as a nice to have 
feature. We are an open source project located over here: 
https://gitlab.com/YottaDB/DB/YDB.

One thing we have in our previous CLI interpreter is the ability to select a 
line for editing by position and have it re-display and put the cursor at the 
end. It works like this:

1. foo
2. boo

>rec 2

>boo<cursor>

I tried to use rl_replace_line(h->line, 1) (h is the history item), then 
rl_redisplay(), but nothing show up.

I looked hard on Github to see if there is any example of this, but not really 
finding anything.

Hope somebody has an idea of how to do it, or if it is not possible at all, or 
if it is possible but my code isn't working (in which case I will try to come 
up with a standalone example).

I am developing against v7.0-150400.25.22 packaged with SUSE Linux Enterprise 
Desktop 15 SP4, but my code will run with whatever version gets dlopen()'ed.

--Sam



reply via email to

[Prev in Thread] Current Thread [Next in Thread]