aboutsummaryrefslogtreecommitdiff
path: root/lua/luatab/init.lua
diff options
context:
space:
mode:
authorManuel Morales <p513manu@gmail.com>2021-07-13 12:16:16 -0500
committerManuel Morales <p513manu@gmail.com>2021-07-13 12:16:16 -0500
commit4aa9bebdb4007428cfca4ffd22e42f08e2cc88ec (patch)
treecb7612f8db51a7a9af800c4a2a46334dceb19e10 /lua/luatab/init.lua
parent1d327eb10b0092b519823950631ae1855755f3a9 (diff)
downloadminitab.nvim-4aa9bebdb4007428cfca4ffd22e42f08e2cc88ec.tar.xz
minitab.nvim-4aa9bebdb4007428cfca4ffd22e42f08e2cc88ec.zip
feat: Solution to issue #3
Used string.match to extract final portion of bufname, this will get the first word of the command run in the terminal which, usually, will be the command running
Diffstat (limited to 'lua/luatab/init.lua')
-rw-r--r--lua/luatab/init.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/lua/luatab/init.lua b/lua/luatab/init.lua
index 597af3a..5e419c2 100644
--- a/lua/luatab/init.lua
+++ b/lua/luatab/init.lua
@@ -11,7 +11,8 @@ local function tabName(bufnr)
elseif file:sub(file:len()-2, file:len()) == 'FZF' then
return 'FZF'
elseif buftype == 'terminal' then
- return 'zsh'
+ _, mtch = string.match(file, "term:(.*):(%a+)")
+ return mtch ~= nil and mtch or 'zsh'
elseif file == '' then
return '[No Name]'
end