mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Move position to center when using "-n" option
Closes #1073, fixes #923
This commit is contained in:
parent
94bddd5a85
commit
5bb6c81615
@ -4840,12 +4840,17 @@ void Notepad_plus::loadCommandlineParams(const TCHAR * commandLine, CmdLineParam
|
|||||||
switchToFile(bufID); //switch to the file. No deferred loading, but this way we can easily move the cursor to the right position
|
switchToFile(bufID); //switch to the file. No deferred loading, but this way we can easily move the cursor to the right position
|
||||||
|
|
||||||
if (cn == -1)
|
if (cn == -1)
|
||||||
|
{
|
||||||
_pEditView->execute(SCI_GOTOLINE, ln-1);
|
_pEditView->execute(SCI_GOTOLINE, ln-1);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int pos = _pEditView->execute(SCI_FINDCOLUMN, ln-1, cn-1);
|
int pos = _pEditView->execute(SCI_FINDCOLUMN, ln-1, cn-1);
|
||||||
_pEditView->execute(SCI_GOTOPOS, pos);
|
_pEditView->execute(SCI_GOTOPOS, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_pEditView->scrollPosToCenter(_pEditView->execute(SCI_GETCURRENTPOS));
|
||||||
|
|
||||||
switchEditViewTo(iView); //restore view
|
switchEditViewTo(iView); //restore view
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user