mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-15 05:33:14 +03:00
Minor fix in cursor positioning on wrapped lines.
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include <eepp/system/pack.hpp>
|
||||
#include <eepp/system/packmanager.hpp>
|
||||
#include <eepp/system/scopedbuffer.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace EE { namespace Audio {
|
||||
|
||||
|
||||
@@ -3061,7 +3061,7 @@ void UICodeEditor::jumpLinesUp( int offset ) {
|
||||
void UICodeEditor::jumpLinesDown( int offset ) {
|
||||
for ( size_t i = 0; i < mDoc->getSelections().size(); ++i ) {
|
||||
TextPosition position = mDoc->getSelections()[i].start();
|
||||
if ( position.line() >= (Int64)mDoc->linesCount() - offset ) {
|
||||
if ( position.line() >= (Int64)mDocView.getVisibleLinesCount() - offset ) {
|
||||
mDoc->setSelection( i, mDoc->endOfDoc(), mDoc->endOfDoc() );
|
||||
} else {
|
||||
mDoc->moveTo( i, moveToLineOffset( position, offset, i ) );
|
||||
@@ -3081,18 +3081,14 @@ void UICodeEditor::jumpLinesDown() {
|
||||
void UICodeEditor::selectToPreviousLine() {
|
||||
for ( size_t i = 0; i < mDoc->getSelections().size(); ++i ) {
|
||||
TextPosition position = mDoc->getSelectionIndex( i ).start();
|
||||
if ( position.line() == 0 ) {
|
||||
mDoc->selectTo( i, mDoc->startOfDoc() );
|
||||
} else {
|
||||
mDoc->selectTo( i, moveToLineOffset( position, -1 ) );
|
||||
}
|
||||
mDoc->selectTo( i, moveToLineOffset( position, -1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
void UICodeEditor::selectToNextLine() {
|
||||
for ( size_t i = 0; i < mDoc->getSelections().size(); ++i ) {
|
||||
TextPosition position = mDoc->getSelectionIndex( i ).start();
|
||||
if ( position.line() == (Int64)mDoc->linesCount() - 1 ) {
|
||||
if ( position.line() == (Int64)mDocView.getVisibleLinesCount() - 1 ) {
|
||||
mDoc->selectTo( i, mDoc->endOfDoc() );
|
||||
} else {
|
||||
mDoc->selectTo( i, moveToLineOffset( position, 1 ) );
|
||||
|
||||
Reference in New Issue
Block a user