mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-28 07:12:07 +00:00 
			
		
		
		
	 8e8d24fe29
			
		
	
	
		8e8d24fe29
		
	
	
	
	
		
			
			This highlighter just syntax highlights the commented lines in your git commit message. It could potentially be enhanced to handle the rebase UI or other more advanced cases in the future.
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			663 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			663 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Brian Gianforcaro <bgianf@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibSyntax/Highlighter.h>
 | |
| 
 | |
| namespace GUI {
 | |
| 
 | |
| class GitCommitSyntaxHighlighter final : public Syntax::Highlighter {
 | |
| public:
 | |
|     GitCommitSyntaxHighlighter() { }
 | |
|     virtual ~GitCommitSyntaxHighlighter() override;
 | |
| 
 | |
|     virtual Syntax::Language language() const override { return Syntax::Language::GitCommit; }
 | |
|     virtual void rehighlight(Palette const&) override;
 | |
| 
 | |
| protected:
 | |
|     virtual Vector<MatchingTokenPair> matching_token_pairs_impl() const override;
 | |
|     virtual bool token_types_equal(u64, u64) const override;
 | |
| };
 | |
| 
 | |
| }
 |