mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 14:54:39 +02:00
Fix auto-indent issue by typing Enter on empty line.
Do not alter indentation if we were at the beginning of the line and we pressed Enter. Fix #443, close #4991
This commit is contained in:
parent
fd51703ad8
commit
08b0156472
@ -2550,6 +2550,11 @@ void Notepad_plus::maintainIndentation(TCHAR ch)
|
|||||||
|
|
||||||
LangType type = _pEditView->getCurrentBuffer()->getLangType();
|
LangType type = _pEditView->getCurrentBuffer()->getLangType();
|
||||||
|
|
||||||
|
// Do not alter indentation if we were at the beginning of the line and we pressed Enter
|
||||||
|
if ((((eolMode == SC_EOL_CRLF || eolMode == SC_EOL_LF) && ch == '\n') ||
|
||||||
|
(eolMode == SC_EOL_CR && ch == '\r')) && prevLine >= 0 && _pEditView->getLineLength(prevLine) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (type == L_C || type == L_CPP || type == L_JAVA || type == L_CS || type == L_OBJC ||
|
if (type == L_C || type == L_CPP || type == L_JAVA || type == L_CS || type == L_OBJC ||
|
||||||
type == L_PHP || type == L_JS || type == L_JAVASCRIPT || type == L_JSP || type == L_CSS)
|
type == L_PHP || type == L_JS || type == L_JAVASCRIPT || type == L_JSP || type == L_CSS)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user