* refactor x11.c and win.c
* Add keyboard shortcut to highlight the thing under the cursor
-* Make Fn keys execute nth command in the tags buffer
+* Make Fn keys execute nth command in the tags buffers
* Run commands in the background and don't block the main thread.
* check for file changes on save
* check for file changes when window regains focus
/* Configuration
*****************************************************************************/
enum {
- Width = 640, /* default window width */
- Height = 480, /* default window height */
- TabWidth = 4, /* maximum number of spaces used to represent a tab */
- ScrollLines = 4, /* number of lines to scroll by for mouse wheel scrolling */
- BufSize = 8192, /* default buffer size */
+ Width = 640, /* default window width */
+ Height = 480, /* default window height */
+ TabWidth = 4, /* maximum number of spaces used to represent a tab */
+ ScrollLines = 4, /* number of lines to scroll by for mouse wheel scrolling */
+ BufSize = 8192, /* default buffer size */
+ FontCacheSize = 16, /* Maximum number of fonts allowed in the font cache */
};
/* choose the font to use for xft */
struct {
XftFont* font;
uint32_t unicodep;
- } cache[MAXFONTS];
+ } cache[FontCacheSize];
int ncached;
};
FcDefaultSubstitute(fcpattern);
FcPattern* fontmatch = FcFontSetMatch(0, fcsets, 1, fcpattern, &fcres);
/* add the font to the cache and use it */
- if (font->ncached >= MAXFONTS) {
- font->ncached = MAXFONTS - 1;
+ if (font->ncached >= FontCacheSize) {
+ font->ncached = FontCacheSize - 1;
XftFontClose(X.display, font->cache[font->ncached].font);
}
font->cache[font->ncached].font = XftFontOpenPattern(X.display, fontmatch);