diff options
author | Tom Tromey <tom@tromey.com> | 2020-05-23 09:23:09 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-05-23 14:53:33 -0600 |
commit | eca1f90cf47a2edc1a1cd22e12c6c0f3b900654e (patch) | |
tree | 78a5fffcd39bab954df305868e98f774c749f01e /gdb/doc | |
parent | 51e2cfa2dc2dd600727c91701c747c28fa67a5df (diff) | |
download | gdb-eca1f90cf47a2edc1a1cd22e12c6c0f3b900654e.zip gdb-eca1f90cf47a2edc1a1cd22e12c6c0f3b900654e.tar.gz gdb-eca1f90cf47a2edc1a1cd22e12c6c0f3b900654e.tar.bz2 |
Add completion styling
Readline has a styling feature for completion -- if it is enabled, the
common prefix of completions will be displayed in a different style.
This doesn't work in gdb, because gdb implements its own completer.
This patch implements the feature. However, it doesn't directly use
the Readline feature, because gdb can do a bit better: it can let the
user control the styling using the existing mechanisms.
This version incorporates an Emacs idea, via Eli: style the prefix,
the "difference character", and the suffix differently.
gdb/ChangeLog
2020-05-23 Tom Tromey <tom@tromey.com>
* NEWS: Add entry for completion styling.
* completer.c (_rl_completion_prefix_display_length): Move
declaration earlier.
(gdb_fnprint): Use completion_style.
(gdb_display_match_list_1): Likewise.
* cli/cli-style.c (completion_prefix_style)
(completion_difference_style, completion_suffix_style): New
globals.
(_initialize_cli_style): Register new globals.
* cli/cli-style.h (completion_prefix_style)
(completion_difference_style, completion_suffix_style): Declare.
gdb/doc/ChangeLog
2020-05-23 Tom Tromey <tom@tromey.com>
* gdb.texinfo (Output Styling): Mention completion styling.
(Editing): Mention readline completion styling.
gdb/testsuite/ChangeLog
2020-05-23 Tom Tromey <tom@tromey.com>
* gdb.base/style.exp: Add completion styling test.
* lib/gdb-utils.exp (style): Add completion styles.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 20 |
2 files changed, 25 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index f19b897..8a86047 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2020-05-23 Tom Tromey <tom@tromey.com> + + * gdb.texinfo (Output Styling): Mention completion styling. + (Editing): Mention readline completion styling. + 2020-05-19 Pedro Alves <palves@redhat.com> * gdb.texinfo (Attach): Update exec-file-mismatch description to diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 6418162..10d4173 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -25271,6 +25271,10 @@ This command accepts the current line for execution and fetches the next line relative to the current line from the history for editing. Any argument is ignored. +Note that @value{GDBN} ignores the Readline +@code{colored-completion-prefix} setting. Instead, this is handled +using the style settings (@xref{Output Styling}). + @node Command History @section Command History @cindex command history @@ -25604,6 +25608,22 @@ general styling to @value{GDBN}. @xref{TUI Configuration}. Control the styling of the active TUI border; that is, the TUI window that has the focus. +@item completion-prefix +Control the styling of the completion prefix. When completing, the +common prefix of completion candidates will be shown with this style. +By default, this style's intensity is dim. + +@item completion-difference +Control the styling of the completion difference character. When +completing, the character that differs between different completions +will be shown using this style. By default, this style's foreground +color is magenta. + +@item completion-suffix +Control the styling of the completion suffix. When completing, the +suffix of completion candidates will be shown with this style. By +default, this style is the same as the default styling. + @end table @node Numbers |