Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (33 sloc) 1.135 kb
// PBCommitMessageView.m
// GitX
// Created by Jeff Mesnil on 13/10/08.
// Copyright 2008 Jeff Mesnil ( All rights reserved.
#import "PBCommitMessageView.h"
#import "PBGitDefaults.h"
@implementation PBCommitMessageView
- (void)drawRect:(NSRect)aRect
NSColor *originalColor = [self backgroundColor];
[originalColor set];
// draw a vertical line after the given size (used as an indicator
// for the first line of the commit message)
float characterWidth = [@" " sizeWithAttributes:[self typingAttributes]].width;
float lineWidth = characterWidth * [PBGitDefaults commitMessageViewVerticalLineLength];
[[NSColor lightGrayColor] set];
// This depends upon the fact that NSTextView always redraws complete lines.
float padding = [[self textContainer] lineFragmentPadding];
NSRect line;
line.origin.x = padding + aRect.origin.x + lineWidth;
line.origin.y = aRect.origin.y;
line.size.width = 1;
line.size.height = aRect.size.height;
[self setBackgroundColor:nil];
[super drawRect:aRect];
[self setBackgroundColor:originalColor];
Jump to Line
Something went wrong with that request. Please try again.