From 36ce0c58a8dfb25d435cffab0b827aebb7cf4ab9 Mon Sep 17 00:00:00 2001 From: gwenn <gtreguier@gmail.com> Date: Sun, 22 Apr 2018 11:37:37 +0200 Subject: [PATCH] Annotate fields with the corresponding readline name --- src/completion.rs | 1 + src/config.rs | 2 +- src/edit.rs | 2 +- src/line_buffer.rs | 4 ++-- src/tty/mod.rs | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/completion.rs b/src/completion.rs index 77470251..778bc43a 100644 --- a/src/completion.rs +++ b/src/completion.rs @@ -68,6 +68,7 @@ pub struct FilenameCompleter { break_chars: BTreeSet<char>, } +// rl_basic_word_break_characters, rl_completer_word_break_characters #[cfg(unix)] static DEFAULT_BREAK_CHARS: [char; 18] = [ ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$', '>', '<', '=', ';', '|', '&', '{', '(', '\0', diff --git a/src/config.rs b/src/config.rs index 4c54e799..d1dbc42b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -5,7 +5,7 @@ use std::default::Default; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Config { /// Maximum number of entries in History. - max_history_size: usize, + max_history_size: usize, // history_max_entries history_duplicates: HistoryDuplicates, history_ignore_space: bool, completion_type: CompletionType, diff --git a/src/edit.rs b/src/edit.rs index e9004208..cea72afb 100644 --- a/src/edit.rs +++ b/src/edit.rs @@ -19,7 +19,7 @@ use undo::Changeset; /// Implement rendering. pub struct State<'out, 'prompt> { pub out: &'out mut Renderer, - prompt: &'prompt str, // Prompt to display + prompt: &'prompt str, // Prompt to display (rl_prompt) prompt_size: Position, // Prompt Unicode/visible width and height pub line: LineBuffer, // Edited line buffer cursor: Position, /* Cursor position (relative to the start of the prompt diff --git a/src/line_buffer.rs b/src/line_buffer.rs index 2316a028..628d66a9 100644 --- a/src/line_buffer.rs +++ b/src/line_buffer.rs @@ -47,8 +47,8 @@ pub trait ChangeListener: DeleteListener { /// /// The methods do text manipulations or/and cursor movements. pub struct LineBuffer { - buf: String, // Edited line buffer - pos: usize, // Current cursor position (byte position) + buf: String, // Edited line buffer (rl_line_buffer) + pos: usize, // Current cursor position (byte position) (rl_point) dl: Option<Rc<RefCell<DeleteListener>>>, cl: Option<Rc<RefCell<ChangeListener>>>, } diff --git a/src/tty/mod.rs b/src/tty/mod.rs index 72dc1fc1..1476be64 100644 --- a/src/tty/mod.rs +++ b/src/tty/mod.rs @@ -116,8 +116,8 @@ impl<'a, R: Renderer + ?Sized> Renderer for &'a mut R { /// Terminal contract pub trait Term { - type Reader: RawReader; - type Writer: Renderer; + type Reader: RawReader; // rl_instream + type Writer: Renderer; // rl_outstream type Mode: RawMode; fn new() -> Self; -- GitLab