diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-04-19 17:56:03 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-04-19 17:56:03 +0530 |
| commit | 0e95e99e72237058465959d55b77750a9d7c1bef (patch) | |
| tree | 5b99cd64f7c49b949a6381c4654ec253822934b5 /TODO.org | |
| parent | 7a458b424c2c1a6ed251211b25261acffef59b7f (diff) | |
| download | null-browser-0e95e99e72237058465959d55b77750a9d7c1bef.tar.gz null-browser-0e95e99e72237058465959d55b77750a9d7c1bef.zip | |
Add web.search and search text implemnetation
Diffstat (limited to '')
| -rw-r--r-- | TODO.org | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -1,6 +1,6 @@ ** Usable - [ ] Tests for api -- [ ] Search text in page +- [X] Search text in page - [ ] Dev tools - [ ] Fullscreen - [ ] Zoom in/out @@ -10,6 +10,7 @@ - [ ] Notifications ** Bugs +- [ ] INVESTIGATE: segfault on api module error - [ ] INVESTIGATE: Check why urlchanged doesnt fire for first url open - [ ] INVESTIGATE: Segfault on close - [ ] INVESTIGATE: Errors in keymap/thread segfaults @@ -84,4 +85,30 @@ web.history.back(1, { win = 1 }) -- Back for current view in win 1 web.keymap.set('n', '<c-r>', ..., { view = 1 }) -- Set keymap for view 1 web.keymap.set('n', '<c-r>', ..., { win = 1 }) -- Set keymap for win 1 web.opt.new_tab_url = 'https://duckduckgo.com' + +-- Search api +web.search.set_search_text('whatever') +web.search.next() +web.search.prev() +web.search.get_search_text() +web.search.current() +web.search.total() + +web.keymap.set('n', '/', function() + dmenu.input({ prompt = 'Search:' }, function(err, input) + if err or not input then return end + web.search.set_search_text(input) + end) +end) +web.keymap.set('n', 'n', function() web.search.next() end) +web.keymap.set('n', 'p', function() web.search.prev() end) + +web.event.add_listener('SearchChanged', { + callback = function() + local label = + web.search.get_search_text() .. ': ' .. web.search.current() .. '/' .. web.search.total() + -- CALL notify-send + -- OR inject js into view to show ui + end, +}) #+end_src |
