From 86cda2c8ba9459faf1b0a41699c14359cb65e0de Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 12 Jan 2017 09:30:02 -0500 Subject: [PATCH] Fixed open at line number functionality --- TODO.md | 2 +- lib/buf.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index ec644ad..48338d6 100644 --- a/TODO.md +++ b/TODO.md @@ -2,8 +2,8 @@ Up Next: -* Add keyboard shortcut to highlight the thing under the cursor * Implement X Selection protocol for handling clipboard and primary selections +* 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 * invalid memory accesses while viewing docs/waf diff --git a/lib/buf.c b/lib/buf.c index ab033c1..b5fca4f 100644 --- a/lib/buf.c +++ b/lib/buf.c @@ -216,6 +216,10 @@ unsigned buf_load(Buf* buf, char* path) { } buf_insert(buf, false, buf_end(buf), r); } + + /* jump to address if we got one */ + if (addr) + off = buf_setln(buf, strtoul(addr, NULL, 0)); /* reset buffer state */ buf->modified = false; -- 2.54.0