Skip to content

Migrate to snacks terminal#16

Open
aweis89 wants to merge 11 commits intomainfrom
migrate-to-snacks
Open

Migrate to snacks terminal#16
aweis89 wants to merge 11 commits intomainfrom
migrate-to-snacks

Conversation

@aweis89
Copy link
Owner

@aweis89 aweis89 commented Jan 29, 2025

No description provided.

- Introduced a new terminal management module in `snacksterm.lua`.
- Refactored `git_stash_finder` to be a local function.
- Enhanced terminal handling with methods for opening, clearing, and
  sending commands to the terminal.
- Updated terminal initialization to support Aider sessions.
- Introduced a new `T.get` function to manage terminal creation.
- Updated `T.terminal` to utilize the new `T.get` function.
- Improved window toggle logic for better terminal management.
The 'style' property has been removed from the window configuration in
the snacksterm module. This change simplifies the window setup and
ensures a more consistent user experience.
Updated class names from AiderTerminal to AiderSnacks and
AiderToggleterm for better clarity and consistency. This change
improves code readability and aligns with the new naming
conventions.
- Refactor `T.get` to accept an optional `cwd` parameter.
- Update `T.terminal` to correctly manage terminal instances
  based on the current working directory.
- Improve documentation for `__terms` field in AiderSnacks.
- Added function to get buffer IDs of split windows.
- Enhanced terminal creation with options for cwd and position.
- Updated terminal error handling to use a consistent notify method.
- Refactored terminal spawning and toggling logic.
- Improved file path handling in the add function.
- Changed the method of obtaining the current working directory
  from `utils.repo_root()` to `Snacks.git.get_root(vim.uv.cwd())`.
- Updated the file path conversion to use `vim.fn.fnamemodify`
  for better compatibility with Neovim's file handling.
- Added a new function `get_root()` to simplify root path retrieval.
- Updated `T.get()` to use `get_root()` for better clarity.
- Modified `T.terminal()` to accept options and improve flexibility.
- Introduced `directions_mapping` for window positioning.
- Adjusted theme colors in `tokyonight.lua` for better visibility.
Added error handling for terminal creation in the send_command function.
If the terminal fails to initialize, a notification is displayed to the user.
- Added support for specifying terminal position in options.
- Refactored terminal retrieval to use a local variable for position.
- Cleaned up commented code related to terminal style.
@aweis89 aweis89 changed the title Migrate to snacks Migrate to snacks terminal Jan 29, 2025
Updated the default position option in the get function from
"right" to "float" to improve user experience and flexibility
in terminal positioning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant