conkeror: Filter results with search string
When using the conkeror interface commands `find-markam-url' and `find-markam-url-new-buffer', the input is sent along to markam and it then searches the titles and tags for the input given.
This commit is contained in:
parent
6fdc8f2f5a
commit
a880a719e5
1 changed files with 14 additions and 6 deletions
|
@ -93,11 +93,20 @@ function markam_complete(input, pos, conservative)
|
|||
let str = input.substring(0, pos);
|
||||
|
||||
var data = "", error = "", ret = [];
|
||||
var result = yield shell_command(
|
||||
var result = 0;
|
||||
|
||||
if (str == "")
|
||||
result = yield shell_command(
|
||||
markam_program + " --script",
|
||||
$fds = [{ output: async_binary_string_writer("") },
|
||||
{ input: async_binary_reader(function (s) data += s || "") },
|
||||
{ input: async_binary_reader(function (s) error += s || "") }]);
|
||||
else
|
||||
result = yield shell_command_with_argument(
|
||||
markam_program + " --script search {}", str,
|
||||
$fds = [{ output: async_binary_string_writer("") },
|
||||
{ input: async_binary_reader(function (s) data += s || "") },
|
||||
{ input: async_binary_reader(function (s) error += s || "") }]);
|
||||
|
||||
if (result != 0 || error != "")
|
||||
throw new interactive_exception("result: " + result +
|
||||
|
@ -110,7 +119,6 @@ function markam_complete(input, pos, conservative)
|
|||
let c = { count: ret.length,
|
||||
get_string: function (i) ret[i][0],
|
||||
get_description: function (i) ret[i][1],
|
||||
// get_value: function (i) ret[i][2],
|
||||
get_input_state: function (i) [ret[i][2]] };
|
||||
yield co_return(c);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue