1
0
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:
Rokt33r
2016-03-15 14:05:33 +09:00
parent 593d242a4c
commit b65101f4be
2 changed files with 12 additions and 1 deletions

View File

@@ -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()

View File

@@ -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