0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 09:12:45 +00:00

Better line position (viewport has some margin)

This commit is contained in:
Trevor Buckner
2024-09-10 01:25:26 -04:00
parent 45a9501459
commit e5ab223571
2 changed files with 5 additions and 3 deletions

View File

@@ -189,7 +189,7 @@ const Editor = createClass({
if (atCursor)
lines = lines.slice(0, this.codeEditor.current.getCursorPosition().line + 1); // get cursor page
else
lines = lines.slice(0, this.codeEditor.current.getViewport().from + 1); // get view page
lines = lines.slice(0, this.codeEditor.current.getTopVisibleLine() + 1); // get view page
return _.reduce(lines, (r, line)=>{
if(