1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

scroll if trying to navigate up to out of screen

This commit is contained in:
Rokt33r
2015-12-22 11:41:51 +09:00
parent fc64c565db
commit 63b199c9c2

View File

@@ -36,6 +36,7 @@ module.exports = React.createClass({
bindKey: {mac: 'Ctrl-P'}, bindKey: {mac: 'Ctrl-P'},
exec: function (editor) { exec: function (editor) {
editor.navigateUp(1) editor.navigateUp(1)
if (editor.getCursorPosition().row < editor.getFirstVisibleRow()) editor.scrollToLine(editor.getCursorPosition().row, false, false)
}, },
readOnly: true readOnly: true
}) })