From: Michael D. Lowis Date: Tue, 17 Jan 2017 15:29:58 +0000 (-0500) Subject: Added option to override tag region contents with EDITTAGS env var X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=7b35a49596c2dd100e25a76650ef7eef09af84f3;p=projs%2Ftide.git Added option to override tag region contents with EDITTAGS env var --- diff --git a/TODO.md b/TODO.md index 29dc2ff..a42e607 100644 --- a/TODO.md +++ b/TODO.md @@ -2,8 +2,8 @@ Up Next: -* Right click in tags region should search edit region * Implement X Selection protocol for handling clipboard and primary selections +* Right click in tags region should search edit region * Add keyboard shortcut to highlight the thing under the cursor * Tag line count should account for wrapped lines * ctrl+alt+f should find next occurence of previous search term diff --git a/xedit.c b/xedit.c index 7e2e794..ba59599 100644 --- a/xedit.c +++ b/xedit.c @@ -197,8 +197,9 @@ static char* SedCmd[] = { "sed", "-e", NULL, NULL }; #ifndef TEST int main(int argc, char** argv) { /* load the buffer views */ + char* tags = getenv("EDITTAGS"); view_init(getview(TAGS), NULL); - view_putstr(getview(TAGS), DEFAULT_TAGS); + view_putstr(getview(TAGS), (tags ? tags : DEFAULT_TAGS)); view_selprev(getview(TAGS)); // clear the selection buf_logclear(getbuf(TAGS)); view_init(getview(EDIT), (argc > 1 ? argv[1] : NULL));