[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>
|
<dialog id="popHelp" popover>
|
||||||
<form>
|
<form>
|
||||||
<header>Help
|
<header>Commands and keys
|
||||||
<button type="button" class="btn-close" aria-label="Close"
|
<button type="button" class="btn-close" aria-label="Close"
|
||||||
onclick="$('popHelp').hidePopover(); "></button>
|
onclick="$('popHelp').hidePopover(); "></button>
|
||||||
</header>
|
</header>
|
||||||
<div id="popHelpInfo" class="modal-body">
|
<div id="popHelpInfo" class="modal-body" style="height: 50vh;overflow:scroll;">
|
||||||
TODO
|
TODO
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
|
@ -87,14 +87,20 @@ $("symbols2").onclick = e => {
|
||||||
|
|
||||||
$("cmd").onclick = e => {
|
$("cmd").onclick = e => {
|
||||||
let cmds = lsp.listCommands(view);
|
let cmds = lsp.listCommands(view);
|
||||||
[...cmds.keys()].forEach(key => {
|
let result="";
|
||||||
console.log(`${key} ${cmds.get(key).key}`)
|
[...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 => {
|
$("symList").addEventListener("itemSelected", e => {
|
||||||
console.log("SYM itemSelected",e.detail);
|
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 => {
|
$("lint").onclick = async e => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue