generated from itdominator/Python-With-Gtk-Template
Buffer list updates preview path; cleanup
This commit is contained in:
parent
9e3a7eab0b
commit
6e34078099
@ -26,7 +26,9 @@
|
||||
<pre id="editor"></pre>
|
||||
|
||||
<!-- Buffers modal -->
|
||||
<div class="modal" id="buffers-modal" tabindex="-1" role="dialog" data-bs-theme="dark">
|
||||
<div class="modal" id="buffers-modal" tabindex="-1" role="dialog"
|
||||
data-bs-theme="dark" data-bs-keyboard="false" data-bs-backdrop="static"
|
||||
>
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -47,6 +49,7 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<span id="preview-path" class="mx-auto"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -94,12 +94,3 @@ document.addEventListener("keydown", (eve) => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// editor.session.selection.on('changeCursor', (eve) => {
|
||||
// let ftype = aceSessions[fhash]["ftype"];
|
||||
// let fpath = aceSessions[fhash]["fpath"];
|
||||
// console.log(eve);
|
||||
|
||||
// // sendMessage("set_labels", ftype, "", fpath, "");
|
||||
// });
|
||||
|
||||
|
@ -76,7 +76,7 @@ const updateSession = (fhash, ftype, fname, fpath) => {
|
||||
const closeSession = () => {
|
||||
let keys = Object.keys(aceSessions);
|
||||
if (keys.length === 1) {
|
||||
const msg = "Can't close last open buffer...";
|
||||
const msg = "Can't close last buffer...";
|
||||
displayMessage(msg, "warning", 3);
|
||||
return;
|
||||
}
|
||||
@ -138,9 +138,12 @@ const listOpenBuffers = () => {
|
||||
liElm.setAttribute("fhash", fhash);
|
||||
|
||||
if (fhash === currentSession) {
|
||||
let fpath = aceSessions[fhash]["fpath"];
|
||||
previewSel = liElm;
|
||||
|
||||
liElm.classList.add("bg-success");
|
||||
liElm.classList.add("bg-info");
|
||||
document.getElementById("preview-path").innerText = fpath;
|
||||
}
|
||||
|
||||
|
||||
@ -152,6 +155,7 @@ const listOpenBuffers = () => {
|
||||
let fhash = eve.target.getAttribute("fhash");
|
||||
let ftype = aceSessions[fhash]["ftype"];
|
||||
let session = aceSessions[fhash]["session"];
|
||||
let fpath = aceSessions[fhash]["fpath"];
|
||||
previewSel = eve.target;
|
||||
|
||||
previewEditor.setSession(session);
|
||||
@ -160,6 +164,7 @@ const listOpenBuffers = () => {
|
||||
previewEditor.session.setMode(`ace/mode/${ftype}`);
|
||||
}
|
||||
|
||||
document.getElementById("preview-path").innerText = fpath;
|
||||
previewSel.classList.add("bg-info");
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user