Skip to content

Commit c6c8ef0

Browse files
committed
refactor: rename telescope_titles config table to titles
1 parent a4c6087 commit c6c8ef0

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Pass the desired options to `lazy`'s `opts`:
4848

4949
```lua
5050
opts = {
51-
telescope_titles = {
51+
titles = {
5252
prompt = "Pick Term",
5353
results = "Terminals"
5454
},
@@ -61,7 +61,7 @@ or call `toggletem-manager`'s `setup` function with the options you want to chan
6161
```lua
6262
config = function()
6363
require("toggleterm-manager").setup {
64-
telescope_titles = {
64+
titles = {
6565
prompt = "Pick Term",
6666
results = "Terminals"
6767
},
@@ -84,7 +84,7 @@ By default, the below table is passed to the `setup` function:
8484
["<C-r>"] = { action = actions.rename_term, exit_on_action = false }, -- provides a prompt to rename a terminal
8585
},
8686
},
87-
telescope_titles = {
87+
titles = {
8888
preview = "Preview", -- title of the preview buffer in telescope
8989
prompt = " Terminals", -- title of the prompt buffer in telescope
9090
results = "Results", -- title of the results buffer in telescope
@@ -114,9 +114,9 @@ By default, the below table is passed to the `setup` function:
114114
| Property | Type | Default Value | Description |
115115
|--------------------|--------------------------------|---------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
116116
| `mappings` | `table` | | A table of key mappings for different modes. Each mode (`i` for insert mode, `n` for normal mode) is a key in the table and maps to another table, where the key is the key combination (e.g., "<C-r>") and the value is a table with the fields `action` and `exit_on_action`. The `action` field is a function that will be called when the key combination is pressed, and `exit_on_action` is a boolean that determines whether Telescope should be exited after the action is performed. See [Mappings](https://github.com/ryanmsnyder/toggleterm-manager.nvim/blob/readme/README.md#mappings) for more info. |
117-
| `telescope_titles.preview` | `string` | "Preview" | Title of the preview buffer in Telescope. Any string. |
118-
| `telescope_titles.prompt` | `string` | " Pick Term" | Title of the prompt buffer in Telescope. Any string. |
119-
| `telescope_titles.results` | `string` | "Results" | Title of the results buffer in Telescope. Any string. |
117+
| `titles.preview` | `string` | "Preview" | Title of the preview buffer in Telescope. Any string. |
118+
| `titles.prompt` | `string` | " Pick Term" | Title of the prompt buffer in Telescope. Any string. |
119+
| `titles.results` | `string` | "Results" | Title of the results buffer in Telescope. Any string. |
120120
| `results.separator` | `string` | " " | The character used to separate each field in `results.field`. Any string, though a space character and a pipe character are the most commonly used. |
121121
| `results.fields` | `{string\|{string, string}}[]` | { "state", "space", "term_icon", "term_name", } | The format and order of the results displayed in the Telescope buffer. This accepts a table where each element is either: an acceptable string a table of tuple-like tables where the first value in the tuple is one of the acceptable strings and the second is a valid NeoVim highlight group that the column should adhere to. The acceptable strings are: `bufname`, `bufnr`, `space`, `state`, `term_name`, `term_icon`. See results for more info. |
122122
| `results.term_icon` | `string` | "" | The icon used for `term_icon` in `results.fields`. Any string. |

lua/config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ local defaults = {
1010
["<C-r>"] = { action = actions.rename_term, exit_on_action = false },
1111
},
1212
}, -- key mappings bound inside the telescope window
13-
telescope_titles = {
13+
titles = {
1414
preview = "Preview", -- title of the preview buffer in telescope
1515
prompt = " Terminals", -- title of the prompt buffer in telescope
1616
results = "Results", -- title of the results buffer in telescope

lua/lib/telescope/init.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ M.open = function(opts)
3737
require("toggleterm.ui").set_origin_window()
3838

3939
local picker = pickers.new(opts, {
40-
prompt_title = config.telescope_titles.prompt,
41-
results_title = config.display_mappings and util.format_results_title(config.mappings)
42-
or config.telescope_titles.results,
43-
preview_title = config.telescope_titles.preview,
40+
prompt_title = config.titles.prompt,
41+
results_title = config.display_mappings and util.format_results_title(config.mappings) or config.titles.results,
42+
preview_title = config.titles.preview,
4443
previewer = conf.grep_previewer(opts),
4544
finder = util.create_finder(),
4645
sorter = conf.generic_sorter(opts),

0 commit comments

Comments
 (0)