Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: more flexible terminal display options #229

Merged

Conversation

zhengpd
Copy link
Contributor

@zhengpd zhengpd commented May 6, 2023

This commit enhance Sniprun configurations with following changes:

  1. Allows to merge user options into default config_values key by key. Consider below situation:
-- config_values
{ display_options = { terminal_width = 45, notification_timeout = 5 } }

-- user options
{ display_options = { terminal_scrollback = 1 } }

-- previous behavior result:
--   overrides display_options and lost default options
{ display_options = { terminal_scrollback = 1 } }

-- new behavior result:
--   merge into default options
{ display_options = { terminal_wdith = 45, notification_timeout = 5, terminal_scrollback = 1 } }

This is implemented with vim.tbl_deep_extend("force", M.config_values, opts).

  1. Sets local non-intrusive scrollback option in terminal buffer. Previous implementation set scrollback=1 changes scrollback globally, which affects non-sniprun terminals.

  2. Adds 3 new display options: terminal_scrollback, terminal_line_number and terminal_signcolumn.

This commit enhance Sniprun configurations with following changes:

1. Allows to merge user options into default config_values key by key.
   Consider below situation:

```lua
-- config_values
{ display_options = { terminal_width = 45, notification_timeout = 5 } }

-- user options
{ display_options = { terminal_scrollback = 1 } }

-- previous behavior result:
--   overrides display_options and lost default options
{ display_options = { terminal_scrollback = 1 } }

-- new behavior result:
--   merge into default options
{ display_options = { terminal_wdith = 45, notification_timeout = 5, terminal_scrollback = 1 } }
```

   This is implemented with `vim.tbl_deep_extend("force", M.config_values, opts)`.

2. Sets local non-intrusive scrollback option in terminal buffer. Previous
   implementation `set scrollback=1` changes scrollback globally, which
   affects non-sniprun terminals.

3. Adds 3 new display options: `terminal_scrollback`,
   `terminal_line_number` and `terminal_signcolumn`.
@michaelb michaelb merged commit 08dcac3 into michaelb:master May 8, 2023
@zhengpd zhengpd deleted the feat/configurable-terminal-display-options branch May 8, 2023 11:00
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.

2 participants