Fix bug where -p0 cmd line arg causes wrong positioning
Fixes small bug introduced by #9143. Close #9150
This commit is contained in:
parent
9f8932b375
commit
bfa44f5db3
@ -5925,10 +5925,13 @@ std::vector<generic_string> Notepad_plus::loadCommandlineParams(const TCHAR * co
|
||||
|
||||
if (cpos != -1)
|
||||
{
|
||||
// make sure not jumping into the middle of a multibyte character
|
||||
// or into the middle of a CR/LF pair for Windows files
|
||||
auto before = _pEditView->execute(SCI_POSITIONBEFORE, cpos);
|
||||
cpos = static_cast<int>(_pEditView->execute(SCI_POSITIONAFTER, before));
|
||||
if (cpos > 0)
|
||||
{
|
||||
// make sure not jumping into the middle of a multibyte character
|
||||
// or into the middle of a CR/LF pair for Windows files
|
||||
auto before = _pEditView->execute(SCI_POSITIONBEFORE, cpos);
|
||||
cpos = static_cast<int>(_pEditView->execute(SCI_POSITIONAFTER, before));
|
||||
}
|
||||
_pEditView->execute(SCI_GOTOPOS, cpos);
|
||||
}
|
||||
else if (cn == -1)
|
||||
|
Loading…
Reference in New Issue
Block a user