diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-05-01 22:21:48 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-05-02 16:20:48 +0530 |
| commit | 86496d0ce96f2e57f3f301c08488b6421321b3c9 (patch) | |
| tree | 2dd20f110c0eec27748b94e6fb84f19fb85ba6d0 /lua | |
| parent | fab5f4d2fd80eb288265c64ba390460ac974ee81 (diff) | |
| download | null-browser-86496d0ce96f2e57f3f301c08488b6421321b3c9.tar.gz null-browser-86496d0ce96f2e57f3f301c08488b6421321b3c9.zip | |
Add PermissionRequested event and accept/reject handling
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/null-browser/defaults/vi.lua | 9 | ||||
| -rw-r--r-- | lua/null-browser/stdlib.lua | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lua/null-browser/defaults/vi.lua b/lua/null-browser/defaults/vi.lua index 1b72f60..cefbbd2 100644 --- a/lua/null-browser/defaults/vi.lua +++ b/lua/null-browser/defaults/vi.lua @@ -1,11 +1,11 @@ local M = {} + local config = { menu = require 'null-browser.extras.dmenu', history = require 'null-browser.extras.history', - preprocess_url = web.utils.string_trim, + transform_url_input = web.utils.string_trim, } - function M.setup(opts) config = web.utils.table_merge(config, opts) end @@ -26,17 +26,16 @@ function M.initialize() -- Open in new view web.keymap.set('n', 'o', function() - print(web.get('new_view_url'), web.get('user_agent')) config.menu.select(config.history.list(), { prompt = 'Open view:' }, function(err, result) if err or not result then return end - web.view.create(config.preprocess_url(result)) + web.view.create(config.transform_url_input(result)) end) end) -- Open in current view web.keymap.set('n', '<s-o>', function() config.menu.select(config.history.list(), { prompt = 'Open:' }, function(err, result) if err or not result then return end - web.view.set_url(config.preprocess_url(result)) + web.view.set_url(config.transform_url_input(result)) end) end) -- Delete from history diff --git a/lua/null-browser/stdlib.lua b/lua/null-browser/stdlib.lua index f96dd48..737f747 100644 --- a/lua/null-browser/stdlib.lua +++ b/lua/null-browser/stdlib.lua @@ -7,6 +7,9 @@ local inspector_loaded, inspector = pcall(require, 'inspect') if inspector_loaded then web.inspect = inspector.inspect else + --- Returns human-readable string representation of Lua tables + --- + --- @link https://github.com/kikito/inspect.lua web.inspect = function(val) print('[warn] "inspect" module not loaded'); return val end |
