Skip to content

Commit

Permalink
refactor(config): renamed property
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Property `terminal_count` is renamed to `terminal_id` for clarity
  • Loading branch information
agoodshort committed Dec 28, 2023
1 parent ae77185 commit 1cca363
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# telescope-git-submodule.nvim

A customizable telescope extension to list the git submodules of your current project and interact with them through the git TUI of your choice.
A customizable Telescope extension to list the git submodules of your current project and interact with them through the git TUI of your choice.

## Features

- List the git submodules of the currently opened project
- Preview the changes for each submodule directly in telescope
- Run the git TUI (or command) of your choice when selecting a submodule in telescope
- Bypass telescope if only one repo/submodule should be displayed
- Preview the files changes for each submodule directly in Telescope
- Run the git TUI (or command) of your choice when selecting a submodule in Telescope
- Bypass Telescope if only one repo/submodule should be displayed

## Installation

Expand All @@ -30,21 +30,30 @@ return {

## Configuration

The extension comes with the following defaults:

```lua
require("telescope").setup({
extensions = {
git_submodules = {
git_cmd = "lazygit",
terminal_count = 9,
terminal_id = 9,
},
},
})
```

### Extension Spec

| Property | Type | Default Value | Description |
|-------------|---------|---------------|----------------------------------|
| git_cmd | string? | "lazygit" | `git` TUI command of your choice |
| terminal_id | number? | 9 | Terminal ID toggleterm will use |

## Roadmap

- [ ] Use the terminal plugin of your choice
- [ ] Keymap to trigger `:DiffView` for the highlighted submodule
- [ ] If there is interest, support additional terminal plugins (e.g., [nvim-terminal](https://github.com/s1n7ax/nvim-terminal))

## Acknowledgements

Expand Down
4 changes: 2 additions & 2 deletions lua/telescope/_extensions/git_submodules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local Terminal = require("toggleterm.terminal").Terminal

local setup_opts = {
git_cmd = "lazygit",
terminal_count = 9,
terminal_id = 9,
}

-- Mention the pointer in the unception thing
Expand All @@ -23,7 +23,7 @@ local function open_git_tool(opts, selection)
close_on_exit = true,
hidden = true,
direction = "float",
count = opts.terminal_count,
count = opts.terminal_id,
})

if selection == dir_name then
Expand Down

0 comments on commit 1cca363

Please sign in to comment.