mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 19:12:38 +00:00 
			
		
		
		
	statusline/lualine: disable LSP status inside toggleterm buffer
This commit is contained in:
		
					parent
					
						
							
								897493a65f
							
						
					
				
			
			
				commit
				
					
						ff5555e3c8
					
				
			
		
					 1 changed files with 11 additions and 1 deletions
				
			
		|  | @ -185,19 +185,29 @@ in { | ||||||
|           { |           { | ||||||
|             { |             { | ||||||
|               -- Lsp server name . |               -- Lsp server name . | ||||||
|  | 
 | ||||||
|               function() |               function() | ||||||
|                 local msg = 'No Active Lsp' |  | ||||||
|                 local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') |                 local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') | ||||||
|  | 
 | ||||||
|  |                 -- Check if the current buffer type is "toggleterm" | ||||||
|  |                 if buf_ft == "toggleterm" then | ||||||
|  |                   return "" | ||||||
|  |                 end | ||||||
|  | 
 | ||||||
|  |                 local msg = 'No Active Lsp' | ||||||
|                 local clients = vim.lsp.get_active_clients() |                 local clients = vim.lsp.get_active_clients() | ||||||
|  | 
 | ||||||
|                 if next(clients) == nil then |                 if next(clients) == nil then | ||||||
|                   return msg |                   return msg | ||||||
|                 end |                 end | ||||||
|  | 
 | ||||||
|                 for _, client in ipairs(clients) do |                 for _, client in ipairs(clients) do | ||||||
|                   local filetypes = client.config.filetypes |                   local filetypes = client.config.filetypes | ||||||
|                   if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then |                   if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then | ||||||
|                     return client.name |                     return client.name | ||||||
|                   end |                   end | ||||||
|                 end |                 end | ||||||
|  | 
 | ||||||
|                 return msg |                 return msg | ||||||
|               end, |               end, | ||||||
|               icon = ' ', |               icon = ' ', | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue