## STAGING
-* Ctrl+D should not pass tag name as arg when executing tag commands
+* Ctrl+D should not pass tag name as arg when executing tag commands
* registrar doesnt match open windows when new file created and is then opened for edit or line number
* implement a mini-sed command to standardize scripts across platforms without relying on sed
* registrar should remove invalid windows from registry when detected
#endif
};
-static int /* Integer config options */
- WinWidth = 640,
- WinHeight = 480,
- ScrollWidth = 5,
- Timeout = 50,
- TabWidth = 4,
- ScrollBy = 1,
- ClickTime = 500,
- CopyIndent = On,
- TrimOnSave = On,
- ExpandTabs = On,
- DosLineFeed = Off;
+#ifdef INCLUDE_DEFS
+/* Integer config options */
+int WinWidth = 640;
+int WinHeight = 480;
+int ScrollWidth = 5;
+int Timeout = 50;
+int TabWidth = 4;
+int ScrollBy = 1;
+int ClickTime = 500;
+int CopyIndent = On;
+int TrimOnSave = On;
+int ExpandTabs = On;
+int DosLineFeed = Off;
+#else
+int WinWidth, WinHeight, ScrollWidth, Timeout, TabWidth, ScrollBy,
+ ClickTime, CopyIndent, TrimOnSave, ExpandTabs, DosLineFeed;
+#endif
static int Palette[ClrCount] = {
[Red] = 0xd1160b, /* Red */
#define OPENCMD "xdg-open"
#endif
-Rule* BuiltinRules[] = {
+static Rule* BuiltinRules[] = {
(Rule[]){ /* Match URLS and open them with the browser */
{ ISSET, "BROWSER", NULL },
{ MATCHES, "data", "^(https?|ftp)://.*" },
+++ /dev/null
-#include <X11/Xlib.h>
-#include <X11/Xresource.h>
-#include <stdc.h>
-#include <utf.h>
-#include <edit.h>
-
-char* FetchCmd[] = { "tfetch", 0, 0 };
-char* TagString = "Del Put Undo Redo | Font Tabs Eol | Find ";
-
-char* Fonts[2] = {
- "Verdana:size=11",
-#ifdef __MACH__
- "Monaco:size=11"
-#else
- "Liberation Mono:size=11"
-#endif
-};
-
-int /* Integer config options */
- WinWidth = 640,
- WinHeight = 480,
- ScrollWidth = 5,
- Timeout = 50,
- TabWidth = 4,
- ScrollBy = 1,
- ClickTime = 500,
- CopyIndent = ON,
- TrimOnSave = ON,
- ExpandTabs = ON,
- DosLineFeed = OFF;
-
-int Palette[ClrCount] = {
- [Red] = 0xd1160b, // Red
- [Green] = 0x1e7b3d, // Green
- [Blue] = 0x0c6cc0, // Blue
- [Yellow] = 0xfed910, // Yellow ???
- [Purple] = 0x7878ba, // Purple ???
- [Aqua] = 0x00695c, // Aqua ???
- [Orange] = 0xf39812, // Orange ???
- [EditBg] = 0xF0F0E5, // Edit region background
- [EditSel] = 0xDFDF99, // Edit region selection
- [EditFg] = 0x000000, // Edit region text
- [EditCsr] = 0x000000, // Edit region cursor
- [TagsBg] = 0xE5F0F0, // Tags region background
- [TagsSel] = 0x99DFDF, // Tags region selection
- [TagsFg] = 0x000000, // Tags region text
- [TagsCsr] = 0x000000, // Tags region cursor
- [ScrollBg] = 0x909047, // Scroll region background
- [ScrollFg] = 0xF0F0E5, // Scroll region foreground
- [VerBdr] = 0x909047, // Vertical border
- [HorBdr] = 0x000000, // Horizontal border
-};
(X.eventfns[e.type])(&X, &e);
for (int status; waitpid(-1, &status, WNOHANG) > 0;);
}
+ /* force update the title */
+ win_title(NULL);
/* determine the size of the regions */
size_t maxtagrows = ((X.height/4) / X.tagfont->height);
size_t tagrows = view_limitrows(win_view(TAGS), maxtagrows);
void win_update(int ms) {
job_poll(ms);
- xupdate(NULL);
}
void win_loop(void) {
#include <win.h>
#include <ctype.h>
#include <unistd.h>
+
+#define INCLUDE_DEFS
#include "config.h"
typedef struct {
static void tabs(char* arg) {
(void)arg;
ExpandTabs = !ExpandTabs;
- win_title(NULL); // force an update of title
}
static void indent(char* arg) {
(void)arg;
CopyIndent = !CopyIndent;
- win_title(NULL); // force an update of title
}
static void eol_mode(char* arg) {
(void)arg;
DosLineFeed = !DosLineFeed;
- win_title(NULL);
View* view = win_view(EDIT);
view_selectall(view);
char* txt = view_getstr(view);
if (line_num) view_setln(win_view(EDIT), line_num);
win_title(path);
win_prop_set("FILE", "file", path);
- } else {
- win_title("*scratch*");
}
/* now create the window and start the event loop */