[add] keyhelp
This commit is contained in:
parent
529b57d628
commit
2baebb3acb
2 changed files with 13 additions and 7 deletions
|
@ -168,11 +168,11 @@
|
|||
|
||||
<dialog id="popHelp" popover>
|
||||
<form>
|
||||
<header>Help
|
||||
<header>Commands and keys
|
||||
<button type="button" class="btn-close" aria-label="Close"
|
||||
onclick="$('popHelp').hidePopover(); "></button>
|
||||
</header>
|
||||
<div id="popHelpInfo" class="modal-body">
|
||||
<div id="popHelpInfo" class="modal-body" style="height: 50vh;overflow:scroll;">
|
||||
TODO
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
|
@ -87,14 +87,20 @@ $("symbols2").onclick = e => {
|
|||
|
||||
$("cmd").onclick = e => {
|
||||
let cmds = lsp.listCommands(view);
|
||||
[...cmds.keys()].forEach(key => {
|
||||
console.log(`${key} ${cmds.get(key).key}`)
|
||||
let result="";
|
||||
[...cmds.keys()].sort().forEach(key => {
|
||||
result+=`<li>${key} ${cmds.get(key).key}</li>`
|
||||
});
|
||||
|
||||
$("popHelpInfo").innerHTML=`<ul>${result}</ul>`
|
||||
$("popHelp").showPopover()
|
||||
console.log(result)
|
||||
};
|
||||
|
||||
$("symList").addEventListener("itemSelected", e => {
|
||||
console.log("SYM itemSelected",e.detail);
|
||||
$("symList").addEventListener("itemSelected", e => {
|
||||
const sel=e.detail.selectionRange;
|
||||
console.log("SYM selection range",sel);
|
||||
const an=17*e.detail.kind
|
||||
view.dispatch({selection: {anchor: an,head:an+34},scrollIntoView:true});
|
||||
});
|
||||
|
||||
$("lint").onclick = async e => {
|
||||
|
|
Loading…
Add table
Reference in a new issue