2022-01-04 23:07:50 +00:00
|
|
|
// @file ScintillaDocument.cpp
|
2013-08-28 00:44:27 +00:00
|
|
|
// Wrapper for Scintilla document object so it can be manipulated independently.
|
|
|
|
// Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
|
|
|
|
|
2015-06-07 21:19:26 +00:00
|
|
|
#include <stdexcept>
|
2019-05-04 18:14:48 +00:00
|
|
|
#include <string_view>
|
2013-08-28 00:44:27 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
2022-01-04 23:07:50 +00:00
|
|
|
#include <set>
|
|
|
|
#include <optional>
|
2019-05-04 18:14:48 +00:00
|
|
|
#include <memory>
|
2013-08-28 00:44:27 +00:00
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
#include "ScintillaTypes.h"
|
|
|
|
#include "ScintillaMessages.h"
|
|
|
|
#include "ScintillaStructures.h"
|
2013-08-28 00:44:27 +00:00
|
|
|
#include "ScintillaDocument.h"
|
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
#include "Debugging.h"
|
|
|
|
#include "Geometry.h"
|
2013-08-28 00:44:27 +00:00
|
|
|
#include "Platform.h"
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
#include "ILoader.h"
|
2013-08-28 00:44:27 +00:00
|
|
|
#include "ILexer.h"
|
|
|
|
#include "Scintilla.h"
|
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
#include "CharacterCategoryMap.h"
|
2019-05-04 18:14:48 +00:00
|
|
|
#include "Position.h"
|
|
|
|
#include "UniqueString.h"
|
2013-08-28 00:44:27 +00:00
|
|
|
#include "SplitVector.h"
|
|
|
|
#include "Partitioning.h"
|
|
|
|
#include "RunStyles.h"
|
|
|
|
#include "ContractionState.h"
|
|
|
|
#include "CellBuffer.h"
|
|
|
|
#include "KeyMap.h"
|
|
|
|
#include "Indicator.h"
|
|
|
|
#include "LineMarker.h"
|
|
|
|
#include "Style.h"
|
|
|
|
#include "ViewStyle.h"
|
|
|
|
#include "CharClassify.h"
|
|
|
|
#include "Decoration.h"
|
|
|
|
#include "CaseFolder.h"
|
|
|
|
#include "Document.h"
|
|
|
|
|
2015-06-07 21:19:26 +00:00
|
|
|
using namespace Scintilla;
|
2022-01-04 23:07:50 +00:00
|
|
|
using namespace Scintilla::Internal;
|
2015-06-07 21:19:26 +00:00
|
|
|
|
2013-08-28 00:44:27 +00:00
|
|
|
class WatcherHelper : public DocWatcher {
|
2019-05-04 18:14:48 +00:00
|
|
|
ScintillaDocument *owner;
|
2013-08-28 00:44:27 +00:00
|
|
|
public:
|
2019-05-04 18:14:48 +00:00
|
|
|
explicit WatcherHelper(ScintillaDocument *owner_);
|
|
|
|
|
|
|
|
void NotifyModifyAttempt(Document *doc, void *userData) override;
|
|
|
|
void NotifySavePoint(Document *doc, void *userData, bool atSavePoint) override;
|
|
|
|
void NotifyModified(Document *doc, DocModification mh, void *userData) override;
|
|
|
|
void NotifyDeleted(Document *doc, void *userData) noexcept override;
|
2021-02-21 04:53:09 +00:00
|
|
|
void NotifyStyleNeeded(Document *doc, void *userData, Sci::Position endPos) override;
|
2022-01-04 23:07:50 +00:00
|
|
|
void NotifyErrorOccurred(Document *doc, void *userData, Status status) override;
|
2013-08-28 00:44:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
WatcherHelper::WatcherHelper(ScintillaDocument *owner_) : owner(owner_) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void WatcherHelper::NotifyModifyAttempt(Document *, void *) {
|
2019-05-04 18:14:48 +00:00
|
|
|
emit owner->modify_attempt();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WatcherHelper::NotifySavePoint(Document *, void *, bool atSavePoint) {
|
2019-05-04 18:14:48 +00:00
|
|
|
emit owner->save_point(atSavePoint);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WatcherHelper::NotifyModified(Document *, DocModification mh, void *) {
|
|
|
|
int length = mh.length;
|
|
|
|
if (!mh.text)
|
|
|
|
length = 0;
|
|
|
|
QByteArray ba = QByteArray::fromRawData(mh.text, length);
|
2022-01-04 23:07:50 +00:00
|
|
|
emit owner->modified(mh.position, static_cast<int>(mh.modificationType), ba, length,
|
|
|
|
mh.linesAdded, mh.line, static_cast<int>(mh.foldLevelNow), static_cast<int>(mh.foldLevelPrev));
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
void WatcherHelper::NotifyDeleted(Document *, void *) noexcept {
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
void WatcherHelper::NotifyStyleNeeded(Document *, void *, Sci::Position endPos) {
|
|
|
|
emit owner->style_needed(endPos);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
void WatcherHelper::NotifyErrorOccurred(Document *, void *, Status status) {
|
|
|
|
emit owner->error_occurred(static_cast<int>(status));
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ScintillaDocument::ScintillaDocument(QObject *parent, void *pdoc_) :
|
Updated to Scintilla 5.4.2 & Lexilla 5.3.1
https://www.scintilla.org/scintilla542.zip
Release 5.4.2
Released 5 March 2024.
Significantly reduce memory used for undo actions, often to a half or quarter of previous versions. Feature #1458.
Add APIs for saving and restoring undo history.
For GTK, when laying out text, detect runs with both left-to-right and right-to-left ranges and divide into an ASCII prefix and more complex suffix. Lay out the ASCII prefix in the standard manner but, for the suffix, measure the whole width and spread that over the suffix bytes. This produces more usable results where the caret moves over the ASCII prefix correctly and over the suffix reasonably but not accurately.
For ScintillaEdit on Qt, fix reference from ScintillaDocument to Document to match change in 5.4.1 using IDocumentEditable for SCI_GETDOCPOINTER and SCI_SETDOCPOINTER.
For Direct2D on Win32, use the multi-threaded option to avoid crashes when Scintilla instances created on different threads. There may be more problems with this scenario so it should be avoided. Bug #2420.
For Win32, ensure keyboard-initiated context menu appears in multi-screen situations.
https://www.scintilla.org/lexilla531.zip
Release 5.3.1
Released 5 March 2024.
Assembler: After comments, treat \r\n line ends the same as \n. This makes testing easier.
Bash: Fix folding when line changed to/from comment and previous line is comment. Issue #224.
Batch: Fix handling ':' next to keywords. Issue #222.
JavaScript: in cpp lexer, add lexer.cpp.backquoted.strings=2 mode to treat ` back-quoted strings as template literals which allow embedded ${expressions}. Issue #94.
Python: fix lexing of rb'' and rf'' strings. Issue #223, Pull request #227.
Ruby: fix lexing of methods on numeric literals like '3.times' so the '.' and method name do not appear in numeric style. Issue #225.
2024-03-06 21:05:54 +00:00
|
|
|
QObject(parent), pdoc(static_cast<Scintilla::IDocumentEditable *>(pdoc_)), docWatcher(nullptr) {
|
2013-08-28 00:44:27 +00:00
|
|
|
if (!pdoc) {
|
2022-01-04 23:07:50 +00:00
|
|
|
pdoc = new Document(DocumentOption::Default);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
docWatcher = new WatcherHelper(this);
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->AddRef();
|
|
|
|
(static_cast<Document *>(pdoc))->AddWatcher(docWatcher, pdoc);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ScintillaDocument::~ScintillaDocument() {
|
|
|
|
Document *doc = static_cast<Document *>(pdoc);
|
|
|
|
if (doc) {
|
|
|
|
doc->RemoveWatcher(docWatcher, doc);
|
|
|
|
doc->Release();
|
|
|
|
}
|
2021-02-21 04:53:09 +00:00
|
|
|
pdoc = nullptr;
|
2013-08-28 00:44:27 +00:00
|
|
|
delete docWatcher;
|
2021-02-21 04:53:09 +00:00
|
|
|
docWatcher = nullptr;
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void *ScintillaDocument::pointer() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return pdoc;
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::line_from_position(int pos) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->LineFromPosition(pos);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ScintillaDocument::is_cr_lf(int pos) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->IsCrLf(pos);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ScintillaDocument::delete_chars(int pos, int len) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->DeleteChars(pos, len);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::undo() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->Undo();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::redo() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->Redo();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ScintillaDocument::can_undo() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->CanUndo();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ScintillaDocument::can_redo() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->CanRedo();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::delete_undo_history() {
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->DeleteUndoHistory();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ScintillaDocument::set_undo_collection(bool collect_undo) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->SetUndoCollection(collect_undo);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ScintillaDocument::is_collecting_undo() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->IsCollectingUndo();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
Updated to Scintilla 5.4.2 & Lexilla 5.3.1
https://www.scintilla.org/scintilla542.zip
Release 5.4.2
Released 5 March 2024.
Significantly reduce memory used for undo actions, often to a half or quarter of previous versions. Feature #1458.
Add APIs for saving and restoring undo history.
For GTK, when laying out text, detect runs with both left-to-right and right-to-left ranges and divide into an ASCII prefix and more complex suffix. Lay out the ASCII prefix in the standard manner but, for the suffix, measure the whole width and spread that over the suffix bytes. This produces more usable results where the caret moves over the ASCII prefix correctly and over the suffix reasonably but not accurately.
For ScintillaEdit on Qt, fix reference from ScintillaDocument to Document to match change in 5.4.1 using IDocumentEditable for SCI_GETDOCPOINTER and SCI_SETDOCPOINTER.
For Direct2D on Win32, use the multi-threaded option to avoid crashes when Scintilla instances created on different threads. There may be more problems with this scenario so it should be avoided. Bug #2420.
For Win32, ensure keyboard-initiated context menu appears in multi-screen situations.
https://www.scintilla.org/lexilla531.zip
Release 5.3.1
Released 5 March 2024.
Assembler: After comments, treat \r\n line ends the same as \n. This makes testing easier.
Bash: Fix folding when line changed to/from comment and previous line is comment. Issue #224.
Batch: Fix handling ':' next to keywords. Issue #222.
JavaScript: in cpp lexer, add lexer.cpp.backquoted.strings=2 mode to treat ` back-quoted strings as template literals which allow embedded ${expressions}. Issue #94.
Python: fix lexing of rb'' and rf'' strings. Issue #223, Pull request #227.
Ruby: fix lexing of methods on numeric literals like '3.times' so the '.' and method name do not appear in numeric style. Issue #225.
2024-03-06 21:05:54 +00:00
|
|
|
void ScintillaDocument::begin_undo_action(bool coalesceWithPrior) {
|
|
|
|
(static_cast<Document *>(pdoc))->BeginUndoAction(coalesceWithPrior);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::end_undo_action() {
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->EndUndoAction();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::set_save_point() {
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->SetSavePoint();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ScintillaDocument::is_save_point() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->IsSavePoint();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::set_read_only(bool read_only) {
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->SetReadOnly(read_only);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ScintillaDocument::is_read_only() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->IsReadOnly();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::insert_string(int position, QByteArray &str) {
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->InsertString(position, str.data(), str.size());
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray ScintillaDocument::get_char_range(int position, int length) {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
const Document *doc = static_cast<Document *>(pdoc);
|
2013-08-28 00:44:27 +00:00
|
|
|
|
|
|
|
if (position < 0 || length <= 0 || position + length > doc->Length())
|
|
|
|
return QByteArray();
|
|
|
|
|
|
|
|
QByteArray ba(length, '\0');
|
|
|
|
doc->GetCharRange(ba.data(), position, length);
|
|
|
|
return ba;
|
|
|
|
}
|
|
|
|
|
|
|
|
char ScintillaDocument::style_at(int position) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->StyleAt(position);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::line_start(int lineno) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->LineStart(lineno);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::line_end(int lineno) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->LineEnd(lineno);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::line_end_position(int pos) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->LineEndPosition(pos);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::length() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->Length();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::lines_total() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->LinesTotal();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
2019-05-04 18:14:48 +00:00
|
|
|
void ScintillaDocument::start_styling(int position) {
|
|
|
|
(static_cast<Document *>(pdoc))->StartStyling(position);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ScintillaDocument::set_style_for(int length, char style) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->SetStyleFor(length, style);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::get_end_styled() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->GetEndStyled();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::ensure_styled_to(int position) {
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->EnsureStyledTo(position);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::set_current_indicator(int indic) {
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->decorations->SetCurrentIndicator(indic);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::decoration_fill_range(int position, int value, int fillLength) {
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->DecorationFillRange(position, value, fillLength);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::decorations_value_at(int indic, int position) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->decorations->ValueAt(indic, position);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::decorations_start(int indic, int position) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->decorations->Start(indic, position);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::decorations_end(int indic, int position) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->decorations->End(indic, position);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ScintillaDocument::get_code_page() {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->CodePage();
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::set_code_page(int code_page) {
|
2019-05-04 18:14:48 +00:00
|
|
|
(static_cast<Document *>(pdoc))->dbcsCodePage = code_page;
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
2015-06-07 21:19:26 +00:00
|
|
|
int ScintillaDocument::get_eol_mode() {
|
2022-01-04 23:07:50 +00:00
|
|
|
return static_cast<int>((static_cast<Document *>(pdoc))->eolMode);
|
2015-06-07 21:19:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScintillaDocument::set_eol_mode(int eol_mode) {
|
2022-01-04 23:07:50 +00:00
|
|
|
(static_cast<Document *>(pdoc))->eolMode = static_cast<EndOfLine>(eol_mode);
|
2015-06-07 21:19:26 +00:00
|
|
|
}
|
|
|
|
|
2013-08-28 00:44:27 +00:00
|
|
|
int ScintillaDocument::move_position_outside_char(int pos, int move_dir, bool check_line_end) {
|
2019-05-04 18:14:48 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->MovePositionOutsideChar(pos, move_dir, check_line_end);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|
|
|
|
|
2015-06-07 21:19:26 +00:00
|
|
|
int ScintillaDocument::get_character(int pos) {
|
2021-02-21 04:53:09 +00:00
|
|
|
return (static_cast<Document *>(pdoc))->GetCharacterAndWidth(pos, nullptr);
|
2013-08-28 00:44:27 +00:00
|
|
|
}
|