<commit_before>package flixel.system.debug.completion;

import openfl.display.Bitmap;
import openfl.display.BitmapData;
import openfl.display.Sprite;
import openfl.text.TextField;
import flixel.util.FlxColor;

class CompletionListEntry extends Sprite
{
	public static inline var WIDTH = 150;
	public static inline var HEIGHT = 20;
	
	private static inline var COLOR_NORMAL = 0xFF5F5F5F;
	private static inline var COLOR_HIGHLIGHT = 0xFF6D6D6D;
	private static inline var GUTTER = 4;
	
	private static var NORMAL_BITMAP_DATA =
		new BitmapData(WIDTH, HEIGHT, true, COLOR_NORMAL);
	
	private static var HIGHLIGHT_BITMAP_DATA =
		new BitmapData(WIDTH, HEIGHT, true, COLOR_HIGHLIGHT);
		
	public var selected(default, set):Bool = false;
	
	private var background:Bitmap;
	private var label:TextField;
	
	public function new() 
	{	
		super();
		
		addChild(background = new Bitmap());
		background.bitmapData = NORMAL_BITMAP_DATA;
		
		label = DebuggerUtil.createTextField();
		label.x = GUTTER;
		label.width = WIDTH;
		addChild(label);
	}
	
	public function setItem(item:String)
	{
		label.text = item;
	}
	
	private function set_selected(selected:Bool):Bool
	{
		if (selected == this.selected)
			return selected;
		
		background.bitmapData = selected ?
			HIGHLIGHT_BITMAP_DATA : NORMAL_BITMAP_DATA;
		
		return this.selected = selected;
	}
}<commit_msg>CompletionListEntry: workaround for a crash on OpenFL next<commit_after>package flixel.system.debug.completion;

import openfl.display.Bitmap;
import openfl.display.BitmapData;
import openfl.display.Sprite;
import openfl.text.TextField;
import flixel.util.FlxColor;

class CompletionListEntry extends Sprite
{
	public static inline var WIDTH = 150;
	public static inline var HEIGHT = 20;
	
	private static inline var COLOR_NORMAL = 0xFF5F5F5F;
	private static inline var COLOR_HIGHLIGHT = 0xFF6D6D6D;
	private static inline var GUTTER = 4;
	
	private static var normalBitmapData:BitmapData;
	private static var highlightBitmapData:BitmapData;

	public var selected(default, set):Bool = false;
	
	private var background:Bitmap;
	private var label:TextField;
	
	public function new() 
	{	
		super();
		
		initBitmapDatas();
		
		addChild(background = new Bitmap());
		background.bitmapData = normalBitmapData;
		
		label = DebuggerUtil.createTextField();
		label.x = GUTTER;
		label.width = WIDTH;
		addChild(label);
	}
	
	private function initBitmapDatas()
	{
		if (normalBitmapData == null)
			normalBitmapData = new BitmapData(WIDTH, HEIGHT, true, COLOR_NORMAL);
		if (highlightBitmapData == null)
			highlightBitmapData = new BitmapData(WIDTH, HEIGHT, true, COLOR_HIGHLIGHT);
	}
	
	public function setItem(item:String)
	{
		label.text = item;
	}
	
	private function set_selected(selected:Bool):Bool
	{
		if (selected == this.selected)
			return selected;
		
		background.bitmapData = selected ?
			highlightBitmapData : normalBitmapData;
		
		return this.selected = selected;
	}
}
{'fraction_non_alphanumeric': 0.0858603066439523, 'fraction_numerical': 0.009540034071550256, 'mean_word_length': 4.6461538461538465, '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': '3014211', 'n_tokens_mistral': 1038, 'n_tokens_neox': 918, 'n_words': 241}