Up Next:
-* add a cap to the distance from last span to first char on screen
-* Ctrl+/ shortcut to comment/uncomment based on syntax
-* ignore the menu key or map it to control
-* implement transaction control in buf.c
-* implement X resources config file
+* highlight all matches of search term
* highlight classes of identifiers
+* implement transaction control in buf.c
* Add a way to CD using a builtin (buffers will track original dir)
* shortcut to jump to previous edit
* add command line flags to toggle options (Tabs, Indent, etc..)
* move by words is inconsistent. Example:
var infoId = 'readerinfo'+reader.id;
+* ignore the menu key or map it to control
The Future:
+* Ctrl+/ shortcut to comment/uncomment based on syntax
* Case insensitive search
* Ctrl+Up,Down requires two undos to revert.
* Ctrl+Up,Down with non line selection should track column
* Scrolling line offset
* Ctrl+Shift+Enter copies indent of wrong line
-* highlight all matches of search term
* Make Fn keys execute nth command in the tags buffers
* jump to previous or next line with less indent
* use transaction ids to only mark buffer dirty when it really is
--- /dev/null
+! UI Settings
+tide.ui.font: Liberation Mono:pixelsize=14:antialias=true:autohint=true
+tide.ui.tags: 'Quit Save Undo Redo Cut Copy Paste | Find '
+tide.ui.width: 640
+tide.ui.height: 480
+tide.ui.line_spacing: 2
+tide.ui.line_numbers: true
+tide.ui.ruler_column: 80
+tide.ui.timeout: 50
+
+! Input and Behavior Settings
+tide.input.copy_indent: true
+tide.input.trim_on_save: true
+tide.input.expand_tabs: true
+tide.input.tab_width: 4
+tide.input.scroll_lines: 4
+tide.input.click_time: 500
+tide.input.max_scan_dist: 8192
+
+! Color Palette Definition
+tide.palette.00: 0xff002b36
+tide.palette.01: 0xff073642
+tide.palette.02: 0xff586e75
+tide.palette.03: 0xff657b83
+tide.palette.04: 0xff839496
+tide.palette.05: 0xff93a1a1
+tide.palette.06: 0xffeee8d5
+tide.palette.07: 0xfffdf6e3
+tide.palette.08: 0xffb58900
+tide.palette.09: 0xffcb4b16
+tide.palette.10: 0xffdc322f
+tide.palette.11: 0xffd33682
+tide.palette.12: 0xff6c71c4
+tide.palette.13: 0xff268bd2
+tide.palette.14: 0xff2aa198
+tide.palette.15: 0xff859900
+
+! Background and UI Colors
+tide.colors.ruler: 0x01
+tide.colors.gutter: 0x01
+tide.colors.bkg_tags: 0x01
+tide.colors.bkg_edit: 0x00
+tide.colors.bkg_scroll: 0x03
+tide.colors.bkg_thumb: 0x00
+tide.colors.border: 0x03
+
+! Base Text Colors
+tide.colors.text.cursor: 0x0007
+tide.colors.text.normal: 0x0004
+tide.colors.text.selected: 0x0400
+tide.colors.text.gutter: 0x0003
+tide.colors.text.currline: 0x0D07
+
+! Syntax Colors
+tide.colors.syntax.normal: 0x0004
+tide.colors.syntax.comment: 0x0002
+tide.colors.syntax.constant: 0x000E
+tide.colors.syntax.string: 0x000E
+tide.colors.syntax.character: 0x000E
+tide.colors.syntax.number: 0x000E
+tide.colors.syntax.booleean: 0x000E
+tide.colors.syntax.float: 0x000E
+tide.colors.syntax.variable: 0x000F
+tide.colors.syntax.function: 0x000E
+tide.colors.syntax.keyword: 0x000E
+tide.colors.syntax.operator: 0x000E
+tide.colors.syntax.preprocessor: 0x000D
+tide.colors.syntax.type: 0x0009
+tide.colors.syntax.statement: 0x000E
+tide.colors.syntax.special: 0x000A
+++ /dev/null
-/* extern the config variables */
-extern char *ShellCmd[], *SedCmd[], *PickFileCmd[], *PickTagCmd[], *OpenCmd[];
-
-/* OS-Specific Config
- ******************************************************************************/
-#ifdef __MACH__
- #define FONT "Monaco:size=10:antialias=true:autohint=true"
- #define LNSPACE 0
-#else
- #define FONT "Liberation Mono:pixelsize=14:antialias=true:autohint=true"
- #define LNSPACE 2
-#endif
-
-/* General Config
- ******************************************************************************/
-enum {
- BufSize = 8192, /* default buffer size */
- FontCacheSize = 16, /* Maximum number of fonts allowed in the font cache */
- DefaultCRLF = 0, /* Default to Unix line endings */
- DefaultCharset = UTF_8, /* We assume UTF-8 because nothing else matters */
- MaxScanDistance = 16384, /* Maximum distance to scan before visible lines for syntax higlighting */
-};
-
-#ifdef INCLUDE_DEFS
-
-/* The shell: Filled in with $SHELL. Used to execute commands */
-char* ShellCmd[] = { NULL, "-c", NULL, NULL };
-
-/* Sed command used to execute commands marked with ':' sigil */
-char* SedCmd[] = { "sed", "-e", NULL, NULL };
-
-/* Fuzzy Picker for files in the current directory and subdirectories */
-char* PickFileCmd[] = { "pickfile", ".", NULL };
-
-/* Fuzzy picker for tags in a ctags database. */
-char* PickTagCmd[] = { "picktag", NULL, "tags", NULL, NULL };
-
-/* Open a new instance of the editor */
-char* OpenCmd[] = { "tide", NULL, NULL };
-
-#undef INCLUDE_DEFS
-#endif
enum {
FontString = 0, TagString, WinWidth, WinHeight, LineSpacing, LineNumbers,
RulerColumn, EventTimeout, CopyIndent, TrimOnSave, ExpandTabs, TabWidth,
- ScrollLines, DblClickTime,
+ ScrollLines, DblClickTime, MaxScanDist,
Color00, Color01, Color02, Color03, Color04, Color05, Color06, Color07,
Color08, Color09, Color10, Color11, Color12, Color13, Color14, Color15,
BkgRuler, BkgGutter, BkgTags, BkgEdit, BkgScroll, BkgThumb, BkgBorder,
#include <edit.h>
#include <ctype.h>
#include <unistd.h>
-#include <config.h>
size_t buf_setln(Buf* buf, size_t line);
size_t buf_getcol(Buf* buf, size_t pos);
buf->modified = false;
buf->expand_tabs = config_get_bool(ExpandTabs);
buf->copy_indent = config_get_bool(CopyIndent);
- buf->charset = DefaultCharset;
- buf->crlf = DefaultCRLF;
- buf->bufsize = BufSize;
+ buf->charset = UTF_8;
+ buf->crlf = 0;
+ buf->bufsize = 8192;
buf->bufstart = (Rune*)malloc(buf->bufsize * sizeof(Rune));
buf->bufend = buf->bufstart + buf->bufsize;
buf->gapstart = buf->bufstart;
#include <stdc.h>
#include <utf.h>
#include <edit.h>
-#include <config.h>
static bool matches(Buf* buf, size_t* off, char* str);
static SyntaxSpan* mkspan(size_t beg, size_t end, size_t clr, SyntaxSpan* span);
[EventTimeout] = { "tide.ui.timeout", INTEGER, { .num = 50 } },
/* input related options */
- [CopyIndent] = { "tide.input.copy_indent", BOOLEAN, { .opt = true } },
- [TrimOnSave] = { "tide.input.trim_on_save", BOOLEAN, { .opt = false } },
- [ExpandTabs] = { "tide.input.expand_tabs", BOOLEAN, { .opt = true } },
- [TabWidth] = { "tide.input.tab_width", INTEGER, { .num = 4 } },
- [ScrollLines] = { "tide.input.scroll_lines", INTEGER, { .num = 4 } },
- [DblClickTime] = { "tide.input.click_time", INTEGER, { .num = 500 } },
+ [CopyIndent] = { "tide.input.copy_indent", BOOLEAN, { .opt = true } },
+ [TrimOnSave] = { "tide.input.trim_on_save", BOOLEAN, { .opt = false } },
+ [ExpandTabs] = { "tide.input.expand_tabs", BOOLEAN, { .opt = true } },
+ [TabWidth] = { "tide.input.tab_width", INTEGER, { .num = 4 } },
+ [ScrollLines] = { "tide.input.scroll_lines", INTEGER, { .num = 4 } },
+ [DblClickTime] = { "tide.input.click_time", INTEGER, { .num = 500 } },
+ [MaxScanDist] = { "tide.input.max_scan_dist", INTEGER, { .num = 8192 } },
/* default color palette definition */
[Color00] = { "tide.palette.00", INTEGER, { .num = 0xff002b36 } },
#include <stdc.h>
#include <utf.h>
#include <edit.h>
-#include <config.h>
#define __USE_XOPEN
#include <wchar.h>
#include <ctype.h>
#include <utf.h>
#include <edit.h>
#include <ctype.h>
-#include <config.h>
typedef size_t (*movefn_t)(Buf* buf, size_t pos, int count);
last = view->rows[view->nrows-1]->off + view->rows[view->nrows-1]->rlen;
view->spans = colors_rewind(view->spans, first);
size_t start = (view->spans ? view->spans->end : 0);
- if (first-start > MaxScanDistance)
- start = first - MaxScanDistance;
+ if (first-start > config_get_int(MaxScanDist))
+ start = first - config_get_int(MaxScanDist);
view->spans = colors_scan(view->syntax, view->spans, &(view->buffer), first, last+1);
apply_colors(view);
}
#include <x11.h>
#include <win.h>
#include <ctype.h>
-#include <config.h>
static void onredraw(int height, int width);
static void oninput(int mods, Rune key);
#include <x11.h>
#include <utf.h>
#include <edit.h>
-#include <config.h>
#include <locale.h>
#include <sys/time.h>
#include <sys/types.h>
+enum { FontCacheSize = 16 };
+
static struct XSel* selfetch(Atom atom);
static void selclear(XEvent* evnt);
static void selnotify(XEvent* evnt);
#include <ctype.h>
#include <shortcuts.h>
-#define INCLUDE_DEFS
-#include "config.h"
-
typedef struct {
float score;
char* string;
static int ShellFD;
-#define INCLUDE_DEFS
-#include "config.h"
-
void onmouseleft(WinRegion id, bool pressed, size_t row, size_t col) {
}
#include <shortcuts.h>
#include <unistd.h>
-#define INCLUDE_DEFS
-#include "config.h"
-
typedef struct {
char* tag;
union {
static char* SearchTerm = NULL;
static size_t Marks[10] = {0};
+/* The shell: Filled in with $SHELL. Used to execute commands */
+char* ShellCmd[] = { NULL, "-c", NULL, NULL };
+
+/* Sed command used to execute commands marked with ':' sigil */
+char* SedCmd[] = { "sed", "-e", NULL, NULL };
+
+/* Fuzzy Picker for files in the current directory and subdirectories */
+char* PickFileCmd[] = { "pickfile", ".", NULL };
+
+/* Fuzzy picker for tags in a ctags database. */
+char* PickTagCmd[] = { "picktag", NULL, "tags", NULL, NULL };
+
+/* Open a new instance of the editor */
+char* OpenCmd[] = { "tide", NULL, NULL };
+
/* Tag/Cmd Execution
******************************************************************************/
static Tag* tag_lookup(char* cmd) {