xaizek / libcursedrl (License: GPLv3+) (since 2019-03-24)
libcursed extension for integration with readline.
Commit b58e3edecac197b076f3a4d837d49eb50abf51ea

Add PromptHistory::limit()
Limits history size.
Author: xaizek
Author date (UTC): 2022-06-25 21:27
Committer name: xaizek
Committer date (UTC): 2022-06-25 21:27
Parent(s): 6470187b60113b74d88f5c36156be3d932af1531
Signing key: 99DC5E4DB05F6BE2
Tree: 8252e4fa2dd1d1f82a7466b7c3ca2667c7b7d69e
File Lines added Lines deleted
PromptRequest.cpp 4 0
PromptRequest.hpp 2 0
File PromptRequest.cpp changed (mode: 100644) (index f1ae7ee..3f6f7cc)
... ... private:
93 93
94 94 } }
95 95
96 void
97 PromptHistory::limit(int limit)
98 { stifle_history(limit); }
99
96 100 void void
97 101 PromptHistory::load(const std::string &path) PromptHistory::load(const std::string &path)
98 102 { static_cast<void>(read_history(path.c_str())); } { static_cast<void>(read_history(path.c_str())); }
File PromptRequest.hpp changed (mode: 100644) (index c8e8b04..86e37a1)
... ... namespace cursedrl {
37 37
38 38 // Groups history management functions. // Groups history management functions.
39 39 namespace PromptHistory { namespace PromptHistory {
40 // Puts a limit on maximum number of history entries.
41 void limit(int limit);
40 42 // Loads history from the file. // Loads history from the file.
41 43 void load(const std::string &path); void load(const std::string &path);
42 44 // Stores history to the file. // Stores history to the file.
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/libcursedrl

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/libcursedrl

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master