mirror of
				https://github.com/folke/lazy.nvim.git
				synced 2025-11-04 08:21:13 +00:00 
			
		
		
		
	feat: git log
This commit is contained in:
		
					parent
					
						
							
								54d5ff18f5
							
						
					
				
			
			
				commit
				
					
						3218c2d9ec
					
				
			
		
					 7 changed files with 83 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -119,6 +119,25 @@ function M:plugin(plugin)
 | 
			
		|||
            self:nl()
 | 
			
		||||
          end
 | 
			
		||||
        end
 | 
			
		||||
      elseif task.type == "log" then
 | 
			
		||||
        local log = vim.trim(task.output)
 | 
			
		||||
        if log ~= "" then
 | 
			
		||||
          local lines = vim.split(log, "\n")
 | 
			
		||||
          for l, line in ipairs(lines) do
 | 
			
		||||
            if l == 1 then
 | 
			
		||||
              self:nl()
 | 
			
		||||
            end
 | 
			
		||||
            local ref, msg, time = line:match("^(%w+) (.*) (%(.*%))$")
 | 
			
		||||
            self:append("      " .. ref .. " ", "@variable.builtin")
 | 
			
		||||
            local col = self:col()
 | 
			
		||||
            self:append(msg)
 | 
			
		||||
            -- string.gsub
 | 
			
		||||
            self:append(" " .. time, "Comment")
 | 
			
		||||
            if l ~= #lines then
 | 
			
		||||
              self:nl()
 | 
			
		||||
            end
 | 
			
		||||
          end
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue