Commit graph

228 commits

Author SHA1 Message Date
Sébastien NOBILI
137d06fb10
fix: set_mode may not be taken into account (#596) 2024-08-08 11:35:40 +01:00
fcying
16a2873e67
feat: add clear_env option (#598) 2024-08-08 11:34:48 +01:00
Gyungmin Myung
74ce6904e1
feat: add shading_ratio option (#580)
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.
2024-06-25 08:35:48 +01:00
Raffaele Mancuso
a9ea8a4c5c
docs: fix code comment typos (#574) 2024-05-19 11:41:23 +01:00
m10090
f059a52c3f
fix: cmd and path now work with paths containing spaces (#483) 2024-04-22 14:21:58 +01:00
Liu(**348**)
5ec59c3a8a
feat: add string array support to open_mapping setting. (#557)
* Add an array type for open_mapping.

* Fix typos and minor fixes.

* Add keymap function to utils.
2024-04-22 12:10:39 +01:00
Raffaele Mancuso
9e65d60cfa
fix: column indexing (#572)
We started in 75d3de9d26, this should finish the job by restoring correct behavior for "single_line" selection type.
2024-04-22 07:59:25 +01:00
Turiiya
dca1c80fb8
fix: autochdir for custom terminals (#553)
* fix: autochdir for custom terminals

* refactor: use ternary expression

can do it like this when the variable is now assigned outside of this block
2024-04-19 12:33:12 +01:00
Feliche-Demian Netliukh
fef08f32b9
fix: clear command (#565) 2024-04-19 12:23:57 +01:00
akinsho
abdc76d229 style(format): run stylua 2024-04-19 11:23:19 +00:00
Raffaele Mancuso
75d3de9d26
fix: cursor position after motion (#563)
nvim_win_set_cursor indexes  rowsfrom 1 but columns from 0, while we
seem to index columns from 1 as well.
2024-04-19 12:23:06 +01:00
Evgeni Chasnovski
d3fff44252
fix: ensure on_choice operates on exact items element (#566)
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.
2024-04-19 12:21:29 +01:00
Yuyuan Yuan
72d2aa290a
feat: support the CR for nushell (#561) 2024-04-19 12:20:04 +01:00
Kevin Amses
63ac4c8529
fix: send_lines_to_terminal now honours ID variable when trim_spaces = false (#541)
Co-authored-by: amsesk <ubuntu@ip-10-128-254-37.ec2.internal>
2024-02-12 10:15:12 +00:00
akinsho
a4bdf1416a style(format): run stylua 2024-01-22 10:37:02 +00:00
Andrei Kochemirovskii
d3aa6e88c2
feat: enable title for floating terminals (#534) 2024-01-22 10:36:47 +00:00
akinsho
ef748d4a6b style(format): run stylua 2023-12-13 08:07:07 +00:00
fisher-j
0532d3a94d
newline_chr is optionally user-specified (#518)
* 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>
2023-12-13 08:06:51 +00:00
akinsho
01d710fc0f style(format): run stylua 2023-11-27 14:40:21 +00:00
Dominique Haeusler
0731e99de5
fix(terminal): clear correctly on windows (#513)
* clear terminal on windows

* adjust clear function for os specific clear command

---------

Co-authored-by: Dominique Haeusler <dominique.haeusler@amcor.com>
2023-11-27 14:40:06 +00:00
Silico_Biomancer
5b84866498
feat: allow operator mapping to send to terminal (#507)
* 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>
2023-11-22 16:49:09 +00:00
Abhinav Natarajan
ef1bbff59c
fix(commands): call ToggleTermSetName with count (#497)
fixes #496
2023-10-02 12:04:54 +01:00
Devansh Sharma
81ea9f71a3
feat: add name param to ToggleTerm and TermExec (#479) 2023-09-11 08:46:23 +02:00
Will Hopkins
6bec54e738
fix(#487): avoid terminal id collisions in __add (#490) 2023-09-11 08:27:56 +02:00
Will Hopkins
01a84bc642
feat: add Terminal.find function (#486) 2023-09-11 07:16:44 +01:00
Akin Sowemimo
0e4dcb8f09 revert: determine custom terminal ids on spawn (#488)
This reverts commit 8572917413.
2023-09-07 08:13:42 +01:00
Will Hopkins
8572917413
fix: determine custom terminal ids on spawn (#488)
* fix: determine custom terminal ids on spawn

* fix: remove redundant nil check

Co-authored-by: Akin <22454918+akinsho@users.noreply.github.com>

---------

Co-authored-by: Akin <22454918+akinsho@users.noreply.github.com>
2023-09-06 13:07:50 +01:00
David O'Trakoun
09fa002166
chore(terminal): cmd is optional in Terminal:new() (#470) 2023-08-03 09:36:40 +01:00
Asror
83871e3c34
fix: TermExec cmd with config.shell as function (#467) 2023-08-02 08:34:35 +01:00
Akin
425a451ead
refactor(terminal): re-use spawn function (#461) 2023-07-17 14:54:14 +01:00
Akin Sowemimo
bacbaa7480 fix(terminal): allow resizing hidden terminals
fixes #459
2023-07-10 09:27:42 +01:00
Towry Wang
029ad968fd
fix: handle errors when switching buffer #453 (#454)
Co-authored-by: towry <towry@users.noreply.github.com>
2023-07-03 22:47:04 +01:00
AThePeanut4
7da102a9c2
fix: replace vim.wo with nvim_set_option_value (#449)
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.
2023-06-26 22:22:38 +02:00
Morgan McCauley
f5cf0b1eeb
feat: allow changing terminal dir in background (#438) 2023-05-22 09:13:38 +01:00
Akin Sowemimo
43b75f43aa fix(float): ensure sidescroll is zero
for floating windows. This relates to and is hopefully a partial fix for
2023-05-16 12:06:59 +01:00
Akin
c8574d7a7d
feat: add a terminal select command (#429) 2023-04-24 19:34:48 +01:00
akinsho
ff5c12627b style(format): run stylua 2023-04-24 18:33:52 +00:00
akinsho
481681ad59 style(format): run stylua 2023-04-09 17:28:06 +00:00
Jakub Kaczor
a7857b6cbf
feat(config): allow shell parameter to be a function (#423)
Co-authored-by: Jakub Kaczor <jakub@jakubkaczor.com>
2023-04-09 18:27:49 +01:00
Maddison Hellstrom
0aa936445b
feat: support z-index option for floating windows (#418) 2023-03-25 08:31:52 +00:00
akinsho
c8e982ad27 style(format): run stylua 2023-03-12 18:19:51 +00:00
Akin
bfb7a7254b
feat(terminal): add mechanism to fetch last focused terminal (#411)
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
2023-03-12 09:57:45 +00:00
Akin Sowemimo
a104063215 tests(terminal): fix broken test
There is no need to assert the first argument of the method which is the
terminal itself only that the real arguments are correct
2023-03-11 15:24:08 +00:00
Akin Sowemimo
d745f4aa3e refactor(toggle): allow calling toggle with no args
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
2023-03-11 13:03:00 +00:00
Melker Ulander
98e15df2c8
feat!: switch persist_mode to false (#410)
by default toggleterm will now remember what mode you were last in when leaving a terminal
2023-03-10 21:02:37 +00:00
Akin Sowemimo
359f06d1f4 chore(terminal): use package annotation over private 2023-02-20 17:59:52 +00:00
Stevan Milic
a5638b2206
feat: restore terminal view on smart toggle (#399)
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.
2023-02-20 17:36:22 +00:00
Stevan Milic
42438b3042
feat: open last toggled term on smart toggle (#397) 2023-02-17 12:16:53 +00:00
Jędrzej Boczar
a54e6c471c
fix: add missing self:on_create() to Terminal:spawn() (#378) 2023-01-13 09:53:57 +00:00
ksk0
8c12749d74
feat: "row" and "col" can be given as function (#343) (#347)
Co-authored-by: koske <dkoscic@riteh.hr>
2023-01-12 10:27:55 +00:00