mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
fix emacs key binding
This commit is contained in:
@@ -40,11 +40,22 @@ export default class CodeEditor extends React.Component {
|
|||||||
this.execHandler = (e) => {
|
this.execHandler = (e) => {
|
||||||
console.log(e.command.name)
|
console.log(e.command.name)
|
||||||
switch (e.command.name) {
|
switch (e.command.name) {
|
||||||
|
case 'gotolinestart':
|
||||||
|
e.preventDefault()
|
||||||
|
{
|
||||||
|
let position = this.editor.getCursorPosition()
|
||||||
|
this.editor.navigateTo(position.row, 0)
|
||||||
|
}
|
||||||
|
break
|
||||||
case 'gotolineend':
|
case 'gotolineend':
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
let position = this.editor.getCursorPosition()
|
let position = this.editor.getCursorPosition()
|
||||||
this.editor.navigateTo(position.row, this.editor.getSession().getLine(position.row).length)
|
this.editor.navigateTo(position.row, this.editor.getSession().getLine(position.row).length)
|
||||||
break
|
break
|
||||||
|
case 'jumptomatching':
|
||||||
|
e.preventDefault()
|
||||||
|
this.editor.navigateUp()
|
||||||
|
break
|
||||||
case 'removetolineend':
|
case 'removetolineend':
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
let range = this.editor.getSelectionRange()
|
let range = this.editor.getSelectionRange()
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default class MainContainer extends React.Component {
|
|||||||
if (window.document.body.style.zoom == null) {
|
if (window.document.body.style.zoom == null) {
|
||||||
window.document.body.style.zoom = 1
|
window.document.body.style.zoom = 1
|
||||||
}
|
}
|
||||||
console.log(window.document.body.style.zoom)
|
|
||||||
let zoom = Number(window.document.body.style.zoom)
|
let zoom = Number(window.document.body.style.zoom)
|
||||||
if (e.deltaY > 0 && zoom < 4) {
|
if (e.deltaY > 0 && zoom < 4) {
|
||||||
document.body.style.zoom = zoom + 0.05
|
document.body.style.zoom = zoom + 0.05
|
||||||
|
|||||||
Reference in New Issue
Block a user