Closed numeredev closed 10 months ago
This is the line indicator option, isn't it?
This is the line indicator option, isn't it?
Exactly
I'm struggling currently to find the variable which will tell me if line indicator is on/off. Where can I find it?
I'm struggling currently to find the variable which will tell me if line indicator is on/off. Where can I find it?
m_options->getSettings()[SETTING_B_LINELENGTH].active()
Kannst du mir mal erklären, warum GetCurrentPos() hier 519 (print ist in OnChar Event von editor.cpp) zurückgibt?
Das ist die logische Position vom Start des Dokuments, deswegen.
You want to try with GetColumn(GetCurrentPos())
noch eine Frage, schielßen sich die Optionen STYLE_COMMENT_LINE, STYLE_COMMENT_BLOCK, STYLE_COMMENT_SECTION_LINE und STYLE_COMMENT_SECTION_BLOCK gegenseitig aus? oder kann currentPos gleichzeitig zwei oder mehrere Style Typ sein?
Am besten einfach hier nachschauen: bool NumeReEditor::isStyleType(StyleType _type, int nPos)
, aber STYLE_COMMENT_SECTION_LINE
sollte Teil von STYLE_COMMENT_LINE
sein (und dasselbe für *_BLOCK
)
sorry für die zahlreichen Fragen, aber wie sehen STYLE_COMMENT_SECTION_LINE und STYLE_COMMENT_SECTION_BLOCK aus? Ich konnte leider kein Beispiel für beiden finden.
sorry für die zahlreichen Fragen, aber wie sehen STYLE_COMMENT_SECTION_LINE und STYLE_COMMENT_SECTION_BLOCK aus? Ich konnte leider kein Beispiel für beiden finden.
## == STYLE_COMMENT_LINE
#* ... *# == STYLE_COMMENT_BLOCK
##! == STYLE_COMMENT_SECTION_LINE
(Dokumentationskommentar)
#*! ... *# == STYLE_COMMENT_SECTION_BLOCK
(Dokumentationskommentar)
DESCRIPTION
What does your feature request improve on? Please describe. Automatic line wrapping would render the line length indicator far more usable than it currently is.
Describe the solution you'd like Provide an option and functionality to handle the line wrapping of (documentation) comments, if the user activated the line length indicator (like in MATLAB). Should be active, if the user adds a character somewhere in a comment line. If a character is removed, it should not do anything. Style has to be copied from the previous line (keeping documentation comments).
Additional context Migrated from here: https://sourceforge.net/p/numere/tickets/775/
(Do not write below this line)
DEVS' SECTION
ANALYSIS
Can be linked into the
NumeReEditor::OnChar()
event handler. Use theNumeReEditor::isStyleType()
function to detect, whether the cursor is currently within a comment line or a comment block (might also be one char right of that -- check that) and if the line length indicator is active and if the line length is longer than the length indicator. Calculate then a correct linebreak position (you may use an adaption ofNumeReEditor::addLinebreaks()
to do that) and insert the line break as"\r\n"
.If the following line is also a comment line (check, whether the style values are identical), then prefix the wrapped contents to this line (possibly creating a recursion). Otherwise simply create a new line with the corresponding style type.
IMPLEMENTATION STEPS
(see also our Wiki for implementation guidelines)
DOCUMENTATION STEPS
(see also our Wiki for further information)
*.NHLP
and*.NDB
files, if needed)*.NLNG
files, if needed)PULL REQUEST