Repository navigation
Conversation
The mergeDeepCull set a unbind key (null) to undefined. In getURL, there are multiple merge operations, and undefined is ignored in the following merge.
|
Uhm, some old commits show up here 🤔 Syntax example: |
usage:
set usercompletions.foo (argv,ctx)=>{
if ((Date.now() - ctx.last) > (60 * 1000)) {
ctx.comp = null
}
if (ctx.comp) return
ctx.comp = [
'arg1', ['option2', 'display text 2']
]
ctx.last = Date.now()
return ctx.comp
}
i think in theory the |
| @@ -738,6 +738,8 @@ export class default_config { | |||
| prev: "^(prev(ious)?|older)\\b|«|<<", | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
please don't forget to give this a good docstring :) . we should bikeshed the name a bit, we try to use vim-style pseudonamespacing where the category comes first
so completionscustom e.g.
There was a problem hiding this comment.
I am fine to follow vim-style naming convension :)
Juse remember to hint me because I dont use vim directly. I use emacs evil ;)
I had a crack at this (apparently 5 months ago 😮) and added a completions_content.ts to handle the messaging between the iframe and the page. The main idea was to message with the prefix and reply with the options (and anything else from the config), that's |
I believe most use case for completion is dealing with page content
|
I move the completion generation into content-script, Moreover, I'm rethinking the API. My first use case is to choose drop-down menu with completion api.
I want to design a elegant API that be able to handle this task. approach 1code example: In this case, user have to pass context object in other way, approach 2Or make the I'm busy with dragon boat festival this weekend, |
It is a very comprehensive implementation! |
|
proposal, javascript apicompletionsetup will return a object easy exampledrop-down menu exampleexcmd style apithis command will open cmdline with 2 completion option.
the cmdline will fill with following exstr and 2 completions after user select Google Inc and call ex.insert_completion the comp command will simply execute the -x option the |
I have been meaning to. It's funny though because since I've had it working I haven't actually used it 😄 so I have neglected it a bit. I was planning on reimplementing existing completions in a way that would let them be easily reused for custom completions, but that feels like it'll take a bit of effort so I never started :) |
usage:
completionsetup -x help -d set -d get -d help
completionsetup -x tabopen -d %2Dc%20foo%20google.com -d google.com
js completionsetup({value: 'a b c'.split(' '), callback(x) {alert(x)}})
js completionsetup({value: 'a b c'.split(' ')}).then(async o => {const choose = await o.promise; alert(choose)})
* completionscustom callback: allow set option.callback * completionsetup -j: function takes full controll of completion
|
Fine, the feature is finished now. We just need to type them correctly and refactor. To build, use the discussAs Chic's branch makes use of Now there are two features, completionsetup and I am also thinking about adding a callback style completion interface inside Tridactyl. @bovine3dom @Chic-Tweetz how do you think? |
do not provide origin command's completion if
there has a custom completion.
for example:
```
alias openfavorite open
set completionscustom.openfavorite ()=>'youtube.com google.com'.split(' ')
```
|
this looks good as a stop-gap before we do #105 (lol) i'm trying to get my head around is the idea that it is used for 'temporary' completions via |
|
I do like the I haven't figured out how to get
If this is similar to the callback stuff I made, I'd like to add the juicy detail that a callback that triggers as you type into the command line is how I got |
|
I have some examples in js-doc, @bovine3dom Does it still worth today?
There is no magic in the first situation, In second situation, it will not work unless we execute About One can define foo as an alias of Another way, one can define the callback by set The callback style magically keep the closure context; we sometimes need this. The first @Chic-Tweetz Right, I may not add many details about the data-structure of completion. |
|
hey @GHolk every few days i look at this and then realise it's really complicated and ... find something else that's easier to work on 😅 could you summarise 1) things you would like me to help you decide and 2) things i should copy and paste into the command line to test? ideally in simple words that my caveman brain can understand sorry and thank you ❤️ |
Similar syntax as jsurls.
How ever I found a problem that javascript code in
commandline_frame.tscan not access webpage's dom. This make usercompletions very limited.
I found that src/completions/Goto.ts use message call to retrieve dom content.
Maybe I should do so for usercompletions.
This revision will not pass the linter and typescript's type checker.