-
-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
372 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This file is part of Notepad Next. | ||
* Copyright 2019 Justin Dailey | ||
* | ||
* Notepad Next is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Notepad Next is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Notepad Next. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#ifndef DOCKEDEDITORTITLEBAR_H | ||
#define DOCKEDEDITORTITLEBAR_H | ||
|
||
|
||
#include <DockAreaTitleBar.h> | ||
|
||
class DockedEditorTitleBar : public ads::CDockAreaTitleBar | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit DockedEditorTitleBar(ads::CDockAreaWidget* parent) : ads::CDockAreaTitleBar(parent) {} | ||
|
||
signals: | ||
void doubleClicked(); | ||
|
||
protected: | ||
void mouseDoubleClickEvent(QMouseEvent *event) { | ||
ads::CDockAreaTitleBar::mouseDoubleClickEvent(event); | ||
|
||
if (event->button() == Qt::LeftButton) { | ||
emit doubleClicked(); | ||
} | ||
} | ||
}; | ||
|
||
#endif // DOCKEDEDITORTITLEBAR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* This file is part of Notepad Next. | ||
* Copyright 2021 Justin Dailey | ||
* | ||
* Notepad Next is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Notepad Next is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Notepad Next. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#include "AutoIndentation.h" | ||
|
||
|
||
using namespace Scintilla; | ||
|
||
AutoIndentation::AutoIndentation(ScintillaEdit *editor) : | ||
EditorDecorator(editor) | ||
{ | ||
} | ||
|
||
void AutoIndentation::notify(const NotificationData *pscn) | ||
{ | ||
if (pscn->nmhdr.code == Notification::CharAdded) { | ||
const int ch = pscn->ch; | ||
const int eolMode = editor->eOLMode(); | ||
|
||
if (((eolMode == SC_EOL_CRLF || eolMode == SC_EOL_LF) && ch == '\n') || (eolMode == SC_EOL_CR && ch == '\r')) { | ||
const int currentLine = editor->lineFromPosition(editor->currentPos()); | ||
const int previousLine = currentLine - 1; | ||
const int previousIndentation = editor->lineIndentation(previousLine); | ||
|
||
if (previousIndentation > 0) { | ||
editor->setLineIndentation(currentLine, previousIndentation); | ||
editor->gotoPos(editor->findColumn(currentLine, previousIndentation)); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* This file is part of Notepad Next. | ||
* Copyright 2021 Justin Dailey | ||
* | ||
* Notepad Next is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Notepad Next is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Notepad Next. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#ifndef AUTOINDENTATION_H | ||
#define AUTOINDENTATION_H | ||
|
||
#include "EditorDecorator.h" | ||
|
||
|
||
class AutoIndentation : public EditorDecorator | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
AutoIndentation(ScintillaEdit *editor); | ||
|
||
public slots: | ||
void notify(const Scintilla::NotificationData *pscn) override; | ||
}; | ||
|
||
#endif // AUTOINDENTATION_H |
Oops, something went wrong.