Added a shading_ratio option that defaults to -3.
The bright background shading factor becomes config.shading_ratio * config.shading_factor after this change.
No breaking change is introduced by this pr.
As `on_choice()` actions depend on modifying terminal objects in place,
make sure to operate on exact element and not a copy. As users can
override `vim.ui.select()`, its implementation might return an item's
copy (which is not explicitly prohibited) making later `on_choice()`
actions not 100% full proof.
* newline_chr is optionally user-specified
R on cmd.exe on windows adds a newline using the current logic (newline
is chosen as: "\r\n"). This proposal makes newline_chr a property of the
terminal, and allows the user to specify it's value when creating
custom terminals.
* remove commented code
* Docs: CUSTOM TERMINAL USAGE
* spelling
Co-authored-by: Akin <22454918+akinsho@users.noreply.github.com>
* remove comment
---------
Co-authored-by: Akin <22454918+akinsho@users.noreply.github.com>
* clear terminal on windows
* adjust clear function for os specific clear command
---------
Co-authored-by: Dominique Haeusler <dominique.haeusler@amcor.com>
* Fix: Send correct visual range when using lua mapping
Fixes#458, I think
* Docs: Document using lua function directly in a mapping
Especially useful for python users
* feat: Add support for opfunc motions
* docs: document use of motion opfunc
---------
Co-authored-by: bluedrink9 <bluedrink9@github.com>
the use of vim.wo to set window options, which behaves counter-intuitively see: neovim/neovim#14595. For window-local options, vim.wo sets both the global and local values of the option, like :set does. This is different to what I would have expected, which is what vim.bo does - it only sets the local value for buffer-local options, like :setlocal does. For global-local options, vim.wo and vim.bo both do the same and act like :setlocal, only setting the local value of the option.
This therefore replaces all uses of vim.wo to set window-local options with nvim_set_option_value, so that only the local value is set, meaning that new buffers created in the ToggleTerm window will not inherit those options.
This is useful for plugins like flatten.nvim where you (read: I) want to be able to check if the last toggled terminal was a float and if not not bother re-opening it
Before passing in an argument of zero was required, this was a very old
behaviour caused by having to define the toggleterm command in viml
which defaulted to passing zero to the command. It's long since not
actually been necessary so this remove this artificial requirement
A continuation of #397 where the idea is taken a bit further, and a complete terminal view is being toggled instead of just the last toggled terminal. When working with the terminals you often want to save your complete view that you've been working on, instead of just closing terminals one by one, and opening them up (again) one by one. There's already a utility mapping that let's you open and close all of your terminals, but this doesn't take into consideration what was previously opened. Therefore to make smart_toggle even smarter we could save the current terminal view, and then open it up the next time it is triggered.
In order to achieve this functionality we could keep a list of terminals that were closed, and use it to go over the list to open them on next smart toggle.