diff options
| -rw-r--r-- | TODO.org | 5 | ||||
| -rw-r--r-- | config.lua | 11 | ||||
| -rw-r--r-- | src/keymap/KeySeqParser.cpp | 5 | ||||
| -rw-r--r-- | src/widgets/BrowserApp.cpp | 1 |
4 files changed, 18 insertions, 4 deletions
@@ -23,13 +23,14 @@ - [X] Configuration lua api - [X] Switch to __internals - [X] Respect cli args for main window -- [ ] Downloading/download path config +- [X] Downloading/download path config - [ ] Use table for internals api options? - [ ] Tests for api - [ ] Log stdout, errors and results from lua somewhere - [ ] Run JS in page +- [ ] INVESTIGATE: Check why urlchanged doesnt fire for first url open - [ ] INVESTIGATE: Segfault on close -- [ ] INVESTIGATE: Errors in keymap segfaults +- [ ] INVESTIGATE: Errors in keymap/thread segfaults ** Next - [ ] Search text in page @@ -108,6 +108,17 @@ web.keymap.set('n', 'b', function() end) end) +-- 1-0 for tab indexes 1-10 +for index = 1, 10 do + local key = index + if index >= 10 then key = 0 end + web.keymap.set('n', '<space>' .. key, function() + local views = web.view.list() + if index > #views then return end + web.view.select(views[index].id) + end) +end + -- Next view web.keymap.set('n', 'tn', function() local views = web.view.list() diff --git a/src/keymap/KeySeqParser.cpp b/src/keymap/KeySeqParser.cpp index aef3b58..555e955 100644 --- a/src/keymap/KeySeqParser.cpp +++ b/src/keymap/KeySeqParser.cpp @@ -57,7 +57,10 @@ Qt::Key KeySeqParser::parse_key(const QString &key_name) { if (key_name.length() == 1) { const char key_char = key_name.toStdString().at(0); - return Qt::Key(Qt::Key_A + (key_char - 'a')); + if (key_char >= 'a' && key_char <= 'z') + return Qt::Key(Qt::Key_A + (key_char - 'a')); + if (key_char >= '0' && key_char <= '9') + return Qt::Key(Qt::Key_0 + (key_char - '0')); } if (key_name == "space") diff --git a/src/widgets/BrowserApp.cpp b/src/widgets/BrowserApp.cpp index 9b65b3a..502d930 100644 --- a/src/widgets/BrowserApp.cpp +++ b/src/widgets/BrowserApp.cpp @@ -21,7 +21,6 @@ BrowserApp::BrowserApp() { lua.load_file_sync("./config.lua"); // Initializes profile - QList profiles{&default_profile}; for (auto *profile : profiles) { profile->setDownloadPath(configuration.downloads_dir()); profile->setHttpUserAgent(configuration.user_agent()); |
