From 7b35a49596c2dd100e25a76650ef7eef09af84f3 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 17 Jan 2017 10:29:58 -0500 Subject: [PATCH] Added option to override tag region contents with EDITTAGS env var --- TODO.md | 2 +- xedit.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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)); -- 2.54.0