From ea3c6942c95c9ea31604afbb826a0a8adfa5b5c1 Mon Sep 17 00:00:00 2001 From: vsemozhetbyt Date: Tue, 26 Apr 2016 16:21:21 +0300 Subject: [PATCH 1/2] doc: extra clarification of historySize option doc: extra clarification of historySize option History caching in the `readline` io is active only for terminal interaction. Appropriate variables are initialized and relevant `_addHistory()` function is called only if exposed `terminal` option of `readline.createInterface()` is set `true` by user or internal output check. This clarification is useful to assure users there will be now wasted overhead connected with history caching if `readline` is used not for terminal interaction (e.g. for reading files line by line). Particularly this fix is helpful after #6352 landing. --- doc/api/readline.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index f939368122d5b3..235006abd55ef0 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -301,7 +301,9 @@ the following values: Defaults to checking `isTTY` on the `output` stream upon instantiation. - `historySize` - maximum number of history lines retained. To disable the - history set this value to `0`. Defaults to `30`. + history set this value to `0`. Defaults to `30`. This option makes sense + only if `terminal` is set `true` by user or by internal `output` check, + otherwise the history caching mechanism is not initialized at all. The `completer` function is given the current line entered by the user, and is supposed to return an Array with 2 entries: From 73351d53a5cedc93e2914e36bc69053e3caf1734 Mon Sep 17 00:00:00 2001 From: vsemozhetbyt Date: Wed, 27 Apr 2016 06:32:09 +0300 Subject: [PATCH 2/2] add missing preposition set `true` -> set to `true` --- doc/api/readline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index 235006abd55ef0..78a95a6abc809e 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -302,7 +302,7 @@ the following values: - `historySize` - maximum number of history lines retained. To disable the history set this value to `0`. Defaults to `30`. This option makes sense - only if `terminal` is set `true` by user or by internal `output` check, + only if `terminal` is set to `true` by user or by internal `output` check, otherwise the history caching mechanism is not initialized at all. The `completer` function is given the current line entered by the user, and