<commit_before>import UIKit

open class ButtonWithTitleAdjustment: UIButton {
	@IBInspectable open var adjustmentLineSpacing: CGFloat = 0 {
		didSet {
			updateAdjustedTitles()
		}
	}
	@IBInspectable open var adjustmentKerning: CGFloat = 0 {
		didSet {
			updateAdjustedTitles()
		}
	}

	open func setAdjustedTitle(_ title: String?, for state: UIControlState) {
		guard let title = title else {
			self.setAttributedTitle(nil, for: state)
			return
		}
		let paragraphStyle = NSMutableParagraphStyle()
		paragraphStyle.lineSpacing = self.adjustmentLineSpacing
		let titleColor = self.titleColor(for: state) ?? .black
		let attributes: [String: Any] = [
			NSParagraphStyleAttributeName: paragraphStyle,
			NSKernAttributeName: self.adjustmentKerning,
			NSForegroundColorAttributeName: titleColor
		]
		let attributedTitle = NSAttributedString(string: title, attributes: attributes)
		self.setAttributedTitle(attributedTitle, for: state)
	}

	open func updateAdjustedTitles() {
		let states: [UIControlState] = [.highlighted, .selected, .disabled, [.selected, .highlighted], [.selected, .disabled]]
		for state in states {
			let title = self.title(for: state)
			setAdjustedTitle(title, for: state)
		}
	}
}
<commit_msg>Fix button title adjustment for normal state<commit_after>import UIKit

open class ButtonWithTitleAdjustment: UIButton {
	@IBInspectable open var adjustmentLineSpacing: CGFloat = 0 {
		didSet {
			updateAdjustedTitles()
		}
	}
	@IBInspectable open var adjustmentKerning: CGFloat = 0 {
		didSet {
			updateAdjustedTitles()
		}
	}

	open func setAdjustedTitle(_ title: String?, for state: UIControlState) {
		guard let title = title else {
			self.setAttributedTitle(nil, for: state)
			return
		}
		let paragraphStyle = NSMutableParagraphStyle()
		paragraphStyle.lineSpacing = self.adjustmentLineSpacing
		let titleColor = self.titleColor(for: state) ?? .black
		let attributes: [String: Any] = [
			NSParagraphStyleAttributeName: paragraphStyle,
			NSKernAttributeName: self.adjustmentKerning,
			NSForegroundColorAttributeName: titleColor
		]
		let attributedTitle = NSAttributedString(string: title, attributes: attributes)
		self.setAttributedTitle(attributedTitle, for: state)
	}

	open func updateAdjustedTitles() {
		let states: [UIControlState] = [.normal, .highlighted, .selected, .disabled, [.selected, .highlighted], [.selected, .disabled]]
		for state in states {
			let title = self.title(for: state)
			setAdjustedTitle(title, for: state)
		}
	}
}

{'fraction_non_alphanumeric': 0.09427880741337631, 'fraction_numerical': 0.0016116035455278, 'mean_word_length': 4.842352941176471, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7648632', 'n_tokens_mistral': 879, 'n_tokens_neox': 777, 'n_words': 191}