This commit is contained in:
Mirek Fidler 2025-11-27 10:50:12 +01:00
commit cbbe8b92a7
24 changed files with 162 additions and 81 deletions

View file

@ -921,7 +921,7 @@ void CodeEditor::MouseMove(Point p, dword flags) {
Size fsz = GetFontSize();
p = (p + fsz * (Size)sb.Get()) / fsz;
int64 h = GetGPos(p.y, p.x);
tippos = h < INT_MAX ? (int)h : -1;
tippos = h < INT_MAX && GetColumnLine(h) == p ? (int)h : -1;
}
SyncTip();
@ -1294,7 +1294,7 @@ void CodeEditor::ForwardWhenBreakpoint(int i) {
WhenBreakpoint(i);
}
void CodeEditor::GotoLine(int line)
void CodeEditor::GotoBarLine(int line)
{
SetCursor(GetPos64(GetLineNo(line)));
}

View file

@ -502,7 +502,7 @@ public:
void SetBreakpoint(int line, const String& b) { bar.SetBreakpoint(line, b); }
void ClearEdited() { bar.ClearEdited(); }
int GetUndoCount() { return undo.GetCount(); }
void GotoLine(int line);
void GotoBarLine(int line);
void EnableBreakpointing() { bar.EnableBreakpointing(true); }
void DisableBreakpointing() { bar.EnableBreakpointing(false); }
void Renumber2();

View file

@ -73,6 +73,7 @@ public:
void Skip();
void SkipTerm() { Skip(); }
void SkipLine();
struct Pos {
const char *ptr;

View file

@ -9,6 +9,8 @@ uint64 cmask16__(uint16x8_t mask) {
return matches;
}
// force_inline uint64 cmask16__(uint16x8_t mask) { return vreinterpretq_s16_u16(mask); }
const uint64 cmask_all__ = 0xffffffffffffffffull;
struct f32x4 {

View file

@ -549,7 +549,7 @@ void CParser::Skip()
term++;
else
if(IsString())
ReadString();
ReadString(false);
else
if(IsChar('\''))
ReadString('\'', false);
@ -564,6 +564,19 @@ void CParser::Skip()
DoSpaces();
}
void CParser::SkipLine()
{
while(*term) {
if(*term == '\n') {
line++;
lineptr = term + 1;
term++;
break;
}
term++;
}
}
CParser::Pos CParser::GetPos() const
{
Pos p;

View file

@ -373,6 +373,11 @@ is advanced by 1 character.&]
[s2;%% Same as Skip, legacy name.&]
[s3; &]
[s4; &]
[s5;:Upp`:`:CParser`:`:SkipLine`(`): [@(0.0.255) void] [* SkipLine]()&]
[s2;%% Skips everything from current position to the end of line.
.&]
[s3; &]
[s4; &]
[s5;:CParser`:`:GetPtr`(`)const: [@(0.0.255) const]_[@(0.0.255) char]_`*[* GetPtr]()_[@(0.0.255) c
onst]&]
[s2;%% Returns a pointer to the current position.&]

View file

@ -4,17 +4,17 @@ namespace Upp {
static bool s_beginner_info_enabled = true;
void EnableBeginnerInfo(bool b)
void EnableBasicHints(bool b)
{
s_beginner_info_enabled = b;
}
bool IsBeginnerInfoEnabled()
bool IsBasicHintsEnabled()
{
return s_beginner_info_enabled;
}
void PaintBeginnerInfo(Draw& w, const Rect& cr, const char *qtf)
void PaintBasicHints(Draw& w, const Rect& cr, const char *qtf)
{
if(!s_beginner_info_enabled)
return;
@ -33,12 +33,12 @@ void PaintBeginnerInfo(Draw& w, const Rect& cr, const char *qtf)
text.Paint(w, r.left + DPI(4), r.top + DPI(4), cx);
}
void PaintBeginnerInfoTopic(Draw& w, Size sz, const char *topic)
void PaintBasicHintsTopic(Draw& w, Size sz, const char *topic)
{
PaintBeginnerInfo(w, sz, GetTopic(topic));
PaintBasicHints(w, sz, GetTopic(topic));
}
void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, const char *key)
void PaintBasicHints(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, const char *key)
{
static Index<String> done_keys;
@ -48,7 +48,7 @@ void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, con
struct Record : Moveable<Record> {
Ptr<Ctrl> ctrl;
String key;
Point mousepos;
int movecount;
int tm;
};
@ -66,7 +66,7 @@ void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, con
Record& r = records.Add();
r.ctrl = ctrl;
r.key = key;
r.mousepos = GetMousePos();
r.movecount = 0;
r.tm = msecs();
}
@ -82,7 +82,7 @@ void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, con
if(testmousepos)
mousepos = GetMousePos();
for(Record& r : records) {
if(testmousepos && Distance(r.mousepos, mousepos) < DPI(50))
if(testmousepos && r.movecount++ < 40)
continue;
if(tm - r.tm > 250) {
if(r.ctrl) {
@ -110,22 +110,22 @@ void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, con
});
}
PaintBeginnerInfo(w, cr, qtf);
PaintBasicHints(w, cr, qtf);
}
void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const char *qtf, const char *key)
void PaintBasicHints(Ctrl *ctrl, Draw& w, const char *qtf, const char *key)
{
PaintBeginnerInfo(ctrl, w, ctrl->GetSize(), qtf, key);
PaintBasicHints(ctrl, w, ctrl->GetSize(), qtf, key);
}
void PaintBeginnerInfoTopic(Ctrl *ctrl, Draw& w, const Rect& cr, const char *topic)
void PaintBasicHintsTopic(Ctrl *ctrl, Draw& w, const Rect& cr, const char *topic)
{
PaintBeginnerInfo(ctrl, w, cr, GetTopic(topic), topic);
PaintBasicHints(ctrl, w, cr, GetTopic(topic), topic);
}
void PaintBeginnerInfoTopic(Ctrl *ctrl, Draw& w, const char *topic)
void PaintBasicHintsTopic(Ctrl *ctrl, Draw& w, const char *topic)
{
PaintBeginnerInfo(ctrl, w, ctrl->GetSize(), GetTopic(topic), topic);
PaintBasicHints(ctrl, w, ctrl->GetSize(), GetTopic(topic), topic);
}
}

View file

@ -537,16 +537,16 @@ void DrawRoundRect(Draw& w, const Rect& r, int radius, Color fill,
void DrawRoundRect(Draw& w, int x, int y, int cx, int cy, int radius, Color fill,
int stroke_width, Color stroke);
void EnableBeginnerInfo(bool b);
bool IsBeginnerInfoEnabled();
void EnableBasicHints(bool b);
bool IsBasicHintsEnabled();
void PaintBeginnerInfo(Draw& w, const Rect& cr, const char *qtf);
void PaintBeginnerInfoTopic(Draw& w, Size sz, const char *topic);
void PaintBasicHints(Draw& w, const Rect& cr, const char *qtf);
void PaintBasicHintsTopic(Draw& w, Size sz, const char *topic);
void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, const char *key);
void PaintBeginnerInfo(Ctrl *ctrl, Draw& w, const char *qtf, const char *key);
void PaintBeginnerInfoTopic(Ctrl *ctrl, Draw& w, const Rect& cr, const char *topic);
void PaintBeginnerInfoTopic(Ctrl *ctrl, Draw& w, const char *topic);
void PaintBasicHints(Ctrl *ctrl, Draw& w, const Rect& cr, const char *qtf, const char *key);
void PaintBasicHints(Ctrl *ctrl, Draw& w, const char *qtf, const char *key);
void PaintBasicHintsTopic(Ctrl *ctrl, Draw& w, const Rect& cr, const char *topic);
void PaintBasicHintsTopic(Ctrl *ctrl, Draw& w, const char *topic);
void Set(ArrayCtrl& array, int ii, IdCtrls& m);
void Get(ArrayCtrl& array, int ii, IdCtrls& m);

View file

@ -1216,7 +1216,7 @@ void LineEdit::DeleteLine()
}
int i = GetLine(cursor);
int p = GetPos32(i);
Remove((int)p, GetLineLength(i) + 1);
Remove(p, GetLineLength(i) + 1);
PlaceCaret(p);
Action();
}

View file

@ -141,7 +141,7 @@ void DiagramEditor::Paint(Draw& w)
if(!fast)
paint_ms = msecs() - t0;
PaintBeginnerInfo(this, w, "Right-click to insert item(s)&Double-click to edit text", "#DiagramEditor");
PaintBasicHints(this, w, "Right-click to insert item(s)&Double-click to edit text", "#DiagramEditor");
}
void DiagramEditor::Sync()

View file

@ -84,7 +84,7 @@ void AssistEditor::EndBeginnerInfo()
void AssistEditor::Paint(Draw& w)
{
CodeEditor::Paint(w);
PaintBeginnerInfoTopic(this, w, "ide/app/EditorBeginnerInfo_en-us");
PaintBasicHintsTopic(this, w, "ide/app/EditorBeginnerInfo_en-us");
}
class IndexSeparatorFrameCls : public CtrlFrame {

View file

@ -390,9 +390,9 @@ void Ide::Serialize(Stream& s)
s % blk0_header;
if(version >= 34) {
bool b = IsBeginnerInfoEnabled();
bool b = IsBasicHintsEnabled();
s % b;
EnableBeginnerInfo(b);
EnableBasicHints(b);
}
#ifdef PLATFORM_WIN32

View file

@ -599,7 +599,7 @@ void Ide::DeleteFound(ArrayCtrl& list)
Sort(lines, [](const Tuple<int, String>& a, Tuple<int, String>& b) { return a.a > b.a; });
for(const auto& m : lines) {
if(m.a < editor.GetLineCount() && m.b == editor.GetUtf8Line(m.a) && !editor.IsReadOnly() && !editor.IsView()) {
editor.GotoLine(m.a);
editor.SetCursor(editor.GetPos(m.a));
editor.DeleteLine();
}
else

View file

@ -110,7 +110,7 @@ void IconDes::Paint(Draw& w)
Size sz = GetSize();
if(!IsCurrent()) {
w.DrawRect(sz, SColorPaper());
PaintBeginnerInfoTopic(this, w, "ide/app/ImlBeginnerInfo_en-us");
PaintBasicHintsTopic(this, w, "ide/app/ImlBeginnerInfo_en-us");
return;
}
const Image& image = Current().image;
@ -269,5 +269,5 @@ void IconDes::Paint(Draw& w)
PaintHotSpot(image.Get2ndSpot(), LtBlue());
}
PaintBeginnerInfoTopic(this, w, "ide/app/ImlBeginnerInfo_en-us");
PaintBasicHintsTopic(this, w, "ide/app/ImlBeginnerInfo_en-us");
}

View file

@ -338,7 +338,7 @@ void LayDes::Paint(Draw& w)
}
}
PaintBeginnerInfoTopic(this, w, "ide/app/LayBeginnerInfo_en-us");
PaintBasicHintsTopic(this, w, "ide/app/LayBeginnerInfo_en-us");
}
void LayDes::SaveState()

View file

@ -78,7 +78,7 @@ Navigator::Navigator()
list.WhenLeftClick = THISBACK(NavigatorClick);
scope.NoHeader();
scope.AddColumn().SetDisplay(Single<ScopeDisplay>());
scope.AddColumn().AddIndex().SetDisplay(Single<ScopeDisplay>());
scope.SetLineCy(max(16, GetStdFontCy()));
scope.NoWantFocus();
scope.WhenSel = [=] { SetList(); };
@ -306,24 +306,32 @@ Size Navigator::NavigatorDisplay::GetStdSize(const Value& q) const
return Size(DoPaint(w, Size(999999, 999999), q, White(), White(), 0), Draw::GetStdFontCy());
}
int Navigator::ScopeDisplay::DoPaint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
int Navigator::ScopeDisplay::DoPaint(Draw& w, const Rect& r, const Value& qa, Color ink, Color paper, dword style) const
{
ValueArray va = qa;
Value q = va[0];
w.DrawRect(r, paper);
int x = 0;
if(IsNull(q) || q == "*") {
const char *txt = "*";
int x = 0;
w.DrawText(r.left, r.top, txt, StdFont().Bold().Italic(),
style & CURSOR ? ink : HighlightSetup::GetHlStyle(HighlightSetup::INK_KEYWORD).color);
x += GetTextSize(txt, StdFont().Bold().Italic()).cx;
return x;
}
String h = q;
if(h.Find('\xff') >= 0)
return PaintFileName(w, r, h, ink);
else
x = PaintFileName(w, r, h, ink);
else {
h = FormatNest(h);
w.DrawText(r.left, r.top, h, StdFont(), ink);
return GetTextSize(h, StdFont()).cx;
w.DrawText(r.left, r.top, h, StdFont(), ink);
x = GetTextSize(h, StdFont()).cx;
}
String ntxt = " (" + AsString(va[1]) + ")";
w.DrawText(r.left + x, r.top, ntxt, StdFont(), Gray());
x += GetTextSize(ntxt, StdFont()).cx;
return x;
}
void Navigator::ScopeDisplay::Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
@ -364,13 +372,14 @@ void Navigator::Search()
int lineno = StrInt(s);
nitem.Clear();
litem.Clear();
Index<String> nests;
VectorMap<String, int> nests;
auto Nest = [&](const AnnotationItem& m, const String& path) {
if(m.nspace == m.nest)
return m.nest + "\xff" + path;
return m.nest;
};
nests.Add(Null);
nests.Add(Null, 0);
int all_count = 0;
String usearch_nest = ToUpper(search_nest);
String usearch_name = ToUpper(search_name);
if(!IsNull(lineno)) {
@ -388,9 +397,10 @@ void Navigator::Search()
NavItem& n = nitem.Add();
(AnnotationItem&)n = m;
n.path = theide->editfile;
nests.FindAdd(n.nest = Nest(m, theide->editfile));
all_count++;
nests.GetAdd(n.nest = Nest(m, theide->editfile), 0)++;
}
SortIndex(nests);
SortByKey(nests);
}
else {
navigator_global = true;
@ -414,14 +424,15 @@ void Navigator::Search()
NavItem& n = nitem.Add();
(AnnotationItem&)n = m;
n.path = f.key;
nests.FindAdd(n.nest = Nest(m, f.key));
all_count++;
nests.GetAdd(n.nest = Nest(m, f.key), 0)++;
set.Add(m.id);
}
}
}
}
SortIndex(nests);
SortByKey(nests);
const Workspace& wspc = GetIdeWorkspace();
String s = ToUpper(TrimBoth(~search));
for(int i = 0; i < wspc.GetCount(); i++) {
@ -435,7 +446,8 @@ void Navigator::Search()
m.pos = Point(0, 0);
m.nest = "<files>";
m.uname = ToUpper(p[j]);
nests.FindAdd(m.nest);
all_count++;
nests.GetAdd(m.nest, 0)++;
}
}
}
@ -443,16 +455,17 @@ void Navigator::Search()
String k = scope.GetKey();
scope.Clear();
scope.Add("*");
scope.Add("*", all_count);
Index<String> set;
for(int nest_pass = 0; nest_pass < 3; nest_pass++)
for(String s : nests) {
for(auto kv : ~nests) {
String s = kv.key;
if(s.GetCount() &&
set.Find(s) < 0 &&
(nest_pass == 2 ? ToUpper(s).Find(usearch_nest) >= 0 :
nest_pass == 1 ? s.Find(search_nest) >= 0 :
s == search_nest)) {
scope.Add(s);
scope.Add(s, kv.value);
set.Add(s);
}
}

View file

@ -385,7 +385,7 @@ void Ide::SetupFormat() {
}
#endif
bool show_basic_hints = IsBeginnerInfoEnabled();
bool show_basic_hints = IsBasicHintsEnabled();
rtvr
(hlt.hilite_scope, hs)
@ -541,7 +541,7 @@ void Ide::SetupFormat() {
web_search.Save();
EnableBeginnerInfo(show_basic_hints);
EnableBasicHints(show_basic_hints);
if(c == IDEXIT)
break;

View file

@ -26,4 +26,8 @@ to end of the file.]&]
[s0; [*@(0.0.255)2 Ctrl`+Delete][2 Delete identifier from cursor to
end.]&]
[s0; [*@(0.0.255)2 Ctrl`+Backspace][2 Delete identifier from cursor
to beginning.]]]
to beginning.]&]
[s0; [2
@@image:120&120/25
(BGAAYAAAAAAAAAAAAHic7dpZbgIxEARQjpWL5P5HIV9IaAL2uLeqXlqaT3D5lQ1SwuPBPz+/z6fkQefOOFLr6UQ+3ubTxf9BmXfvAu3ctQe0a9cerDxOp3sPkdYRnaA9T4bJ3LILtOtu2M2/TYUeMrpfJ2sH2d2vk6mDKPvoz7YMHXg6SL4fUTmq2FubR+Zismd1986ZzR7l7pk5gz3a2zs/qz3a17KHyA462TN20M3eam9jn7sDbTa0XVQHu9cjzj7qLKLWtvZnstdM1g6kOVjcvXJJ18hk7zVZOqhoH5lT41/17Ftnlb5/hbPv/R6oO4A8+9ZmrP6rDljPvlenbHeA9eyz9erhL1mD+ewzvP/qNSxnv2u/Wv8sNuh93PFnzF3d/70DpE2EPes5Qn/2rNbL5i9Zg83f8xn/8f/kj85cxd56ner2XnuxWquCf7T9+N+zH/+a9uOPte/uj7bv7M9g39Wfxb6jP5N9N382+/HH5+ziz2hv7ca4P+ZskkxZ//7MmO00U9a//6+GMVcX/2y5GP7/XsVfYsXw+5Pq/qvXMPz+qqs/0+8Ps/tLjJh+f5v9kfhc/bPdAZbH4uyPP7f/dGBr8s1/7oC//8o+yx1gzrDLsfPPcAeYM6xy3LHPcAdY199luOvP3gHj2pb2Gv8IB7Z1PfyZO2Ba08t+54/uIPLR7lPqr70DFTrQ7lFj370DBvudf9UOLPZk5d+tAzZ7yw6Ye7DK72Fv3QFTD5aZPe09OkD2YJ0zwv5uB8w9eOSKtPfswKsLzxwI+5MONPuX9hG1HtL+NVEmUZPJ/jWRZ9NrTvaA9v400Z8RVnOaG+28m8jvxyjzDO7vI9mfdxeaTGhP6Wj2rOnEal20n9VYeUQ9aC+vQbt2db8O2rmr+6cZc54Zc76pbP0HrMjArg==)
][2 for more tips]]]

View file

@ -1,6 +1,9 @@
TITLE("Ctrl+Tab - cycle through files")
COMPRESSED
120,156,141,147,219,110,155,64,16,134,95,101,164,164,85,18,187,230,224,197,68,246,77,109,112,155,139,52,138,234,70,85,133,80,205,97,48,171,226,93,180,44,161,86,213,119,239,2,118,157,54,134,132,43,164,153,249,191,127,231,224,221,144,89,120,61,158,93,17,56,63,55,134,250,153,110,95,79,136,65,108,66,44,115,108,91,132,152,58,33,134,161,254,13,203,158,216,246,84,82,153,161,239,53,69,3,195,176,85,157,57,52,207,12,139,76,28,211,113,235,220,197,124,161,207,205,137,99,141,137,59,249,96,24,75,215,24,79,139,50,220,151,170,10,189,38,189,240,77,93,76,130,50,147,190,247,235,251,239,55,203,187,119,15,43,240,10,125,6,222,213,251,11,125,164,143,76,203,186,52,193,145,34,91,15,190,4,161,239,153,0,206,46,202,16,18,154,97,49,242,223,250,39,242,151,69,4,117,234,42,229,149,150,210,24,33,228,82,242,45,228,1,195,142,154,121,38,215,131,91,76,100,195,208,84,253,243,240,103,186,73,219,248,71,14,97,16,253,208,18,46,170,64,196,29,154,
173,239,181,119,90,114,31,245,155,232,29,254,148,42,37,23,248,72,121,89,192,54,144,81,74,217,6,66,161,56,40,123,9,221,182,219,248,209,247,253,65,95,3,86,19,43,254,130,121,167,109,57,207,119,80,96,134,145,164,156,1,77,32,96,187,161,130,105,38,68,165,16,200,36,100,148,97,147,204,101,138,162,162,69,87,167,91,225,111,205,132,46,184,56,109,249,182,142,94,130,83,202,127,0,29,146,135,213,120,246,254,85,74,19,121,92,157,175,41,178,167,239,40,32,198,68,201,198,67,160,44,174,33,199,160,168,155,166,20,51,213,220,14,236,94,189,117,252,144,247,90,104,147,92,94,177,38,237,19,127,196,230,69,218,145,88,230,90,172,226,189,109,235,162,252,39,191,138,4,207,178,131,98,159,224,125,176,193,189,104,231,48,110,248,22,219,121,168,189,151,106,245,113,67,25,240,4,212,164,155,67,236,181,92,19,254,26,235,100,44,89,252,20,129,44,126,53,192,85,29,148,237,238,181,191,64,235,89,210,132,162,128,68,168,187,87,43,84,40,112,171,219,171,181,80,215,
86,228,65,244,74,185,166,19,76,221,233,200,247,253,63,0,240,142,180,
120,156,141,85,11,143,154,88,20,254,43,36,221,109,218,50,219,11,151,199,133,105,154,20,69,197,25,148,235,91,153,152,45,143,139,128,60,148,151,202,102,255,251,162,182,59,221,109,157,150,132,112,146,115,206,247,125,231,21,158,52,254,131,45,113,31,222,241,212,111,191,177,119,204,43,6,73,34,207,242,136,231,5,200,33,129,231,33,195,243,44,219,216,172,128,68,132,238,139,160,136,200,250,233,146,68,179,44,106,242,224,29,124,197,10,188,216,134,109,245,28,219,82,90,140,2,197,182,192,241,170,216,101,217,142,202,114,247,121,105,127,73,109,50,152,51,211,79,158,123,149,120,86,25,21,235,167,191,254,252,251,247,206,240,143,217,132,122,202,153,15,212,211,187,79,111,152,247,204,123,40,8,111,33,213,46,178,232,51,61,181,236,245,19,164,168,246,201,137,8,229,5,17,201,223,175,95,175,127,16,223,201,29,234,28,58,241,211,3,240,3,151,80,118,90,20,105,76,237,172,132,220,200,81,162,226,51,173,19,175,184,112,128,38,255,123,247,56,216,248,87,127,47,165,108,203,
217,2,47,205,14,86,230,222,192,188,234,254,252,244,99,200,47,222,245,197,59,36,199,162,9,217,101,164,10,210,50,167,98,171,112,252,32,217,80,118,214,240,144,226,69,134,219,178,175,254,103,221,248,43,62,160,146,51,227,33,253,137,248,246,181,229,233,238,68,229,36,34,78,17,164,9,21,120,148,149,156,238,26,50,0,41,167,204,50,146,20,84,20,36,228,18,156,22,62,201,14,65,126,171,211,87,224,213,101,66,111,210,236,199,146,245,179,247,45,213,46,139,255,16,220,128,252,186,26,223,213,63,241,3,175,120,94,157,133,79,146,111,235,200,41,151,120,13,172,123,71,5,137,123,38,121,118,102,231,166,53,136,81,211,220,27,180,95,208,175,138,103,187,23,37,92,131,212,244,144,92,194,6,105,69,46,21,129,103,198,114,7,220,198,255,98,219,110,177,252,15,126,226,100,105,20,125,69,124,9,16,91,27,242,5,244,230,48,180,52,38,215,121,52,123,95,52,171,79,54,65,66,165,30,213,76,250,114,136,47,74,62,51,252,43,236,38,71,39,113,191,165,32,137,251,203,
4,106,211,193,226,186,123,87,147,10,206,179,12,188,128,100,148,151,53,119,223,172,80,222,16,95,113,95,196,106,53,215,150,239,44,231,23,225,46,157,72,154,59,125,6,133,212,167,79,65,220,212,124,207,66,230,117,243,2,40,188,105,245,20,101,165,124,243,104,129,131,220,157,105,111,250,199,142,50,30,133,187,133,46,96,65,235,207,229,190,165,232,176,212,201,126,25,237,173,41,167,10,209,136,157,28,74,220,194,53,13,106,209,219,142,136,103,24,93,61,19,103,35,154,43,237,233,209,147,91,241,210,171,148,146,115,138,17,97,44,217,33,153,122,52,118,92,142,183,238,106,156,88,138,60,229,237,7,78,239,235,133,81,148,112,0,193,116,53,35,131,108,231,61,192,92,131,46,172,182,98,172,62,226,42,173,209,106,160,45,55,226,68,231,189,217,52,222,195,110,105,143,105,51,200,99,151,149,37,209,172,199,40,66,187,173,176,169,57,11,214,57,216,55,95,22,61,106,39,133,23,225,116,8,153,1,71,172,88,14,19,148,171,246,212,98,150,243,145,86,202,78,88,135,104,175,
63,234,139,162,50,147,188,112,7,236,70,220,26,243,208,169,150,15,15,172,228,111,81,61,55,141,189,159,106,66,52,229,89,192,162,110,145,68,182,0,124,27,87,96,44,166,6,175,72,180,108,198,25,22,51,53,10,113,21,145,196,214,136,34,147,83,45,147,204,215,217,88,165,201,161,174,48,216,15,39,199,164,130,37,88,84,82,62,44,125,153,195,221,164,238,114,46,64,140,186,235,192,14,38,185,48,74,0,204,134,182,46,4,178,185,145,56,79,58,38,64,242,192,54,148,4,231,232,10,98,66,50,184,76,202,227,98,95,182,61,52,149,233,33,93,107,128,182,228,210,192,5,1,101,136,236,10,13,228,13,39,47,188,163,45,134,88,24,202,67,78,130,52,208,52,129,174,131,26,250,21,114,44,30,211,102,190,221,30,77,0,208,32,54,24,102,38,91,0,136,116,111,48,119,150,0,158,132,30,70,96,153,207,189,85,190,60,208,2,222,131,125,181,28,52,131,222,239,115,192,208,18,206,65,161,135,15,62,237,9,149,188,245,124,7,216,216,85,76,91,227,203,19,198,200,3,
110,175,149,73,57,11,80,218,6,64,74,233,211,145,221,212,153,170,231,30,198,142,66,86,3,241,120,226,116,173,177,221,21,43,203,81,105,84,152,219,104,33,220,217,176,87,73,253,22,50,89,236,157,76,3,182,44,70,42,104,129,7,101,31,235,205,148,241,62,107,250,213,157,102,35,20,117,67,174,177,91,85,233,122,242,204,208,177,185,21,92,186,80,106,19,157,14,226,138,32,245,17,193,110,197,141,186,83,85,176,76,76,24,217,216,170,112,245,192,212,135,74,40,91,210,65,38,198,228,177,192,94,126,120,204,245,250,120,232,211,194,192,24,226,114,41,251,61,86,43,116,122,56,239,196,51,19,63,128,112,49,54,229,97,54,173,154,165,173,120,134,49,165,241,60,49,172,30,13,165,88,10,171,227,41,172,85,3,85,125,57,246,220,35,177,166,61,31,139,139,16,102,70,210,177,34,200,36,242,124,69,102,35,217,106,211,213,200,46,160,107,75,6,204,226,140,22,29,211,17,120,211,65,226,206,198,140,150,13,66,37,219,124,252,248,246,114,230,205,95,156,138,211,140,80,69,
176,203,215,235,245,63,255,103,198,100,

View file

@ -200,7 +200,6 @@ void Ide::EditSpecial(Bar& menu)
.Help("Comment code lines");
menu.Add(b && editor.IsSelection(), AK_UNCOMMENT, THISBACK(UnComment))
.Help("Uncomment code");
FindDs(menu);
menu.MenuSeparator();
menu.Add(AK_COPY_POSITION, [=] { CopyPosition(); });
menu.Add(AK_GOTO_POSITION, [=] { GotoPosition(); });

View file

@ -757,11 +757,11 @@ void Ide::EditAsText()
layout = "LAYOUT(" + layout + ",";
for(int i = 0; i < editor.GetLineCount(); i++)
if(TrimBoth(editor.GetUtf8Line(i)).StartsWith(layout)) {
editor.GotoLine(i);
editor.GotoBarLine(i);
if(item.GetCount())
for(int j = i + 1; j < editor.GetLineCount(); j++)
if(GetLayItemId(editor.GetUtf8Line(j)) == item) {
editor.GotoLine(j);
editor.GotoBarLine(j);
break;
}
break;

View file

@ -534,9 +534,6 @@ void Ide::FindDs(int where)
{
SaveFile();
static Index<String> ds = { "DLOG", "DDUMP", "DDUMPC", "DDUMPM", "DTIMING",
"DLOGHEX", "DDUMPHEX", "DTIMESTOP", "DHITCOUNT" };
NewFFound();
String nest_dir = GetPathNest(editfile);
@ -567,6 +564,42 @@ void Ide::FindDs(int where)
for(String fn : files) {
if(pi.SetCanceled(n++, files.GetCount()))
break;
if(GetFileLength(fn) < 10*1024*1024) {
String text = LoadFile(fn);
try {
CParser p(text);
bool ignore = false;
while(!p.IsEof()) {
CParser::Pos pos = p.GetPos();
if(p.Char('#')) {
if(p.Id("if") || p.Id("ifdef"))
ignore = true;
else
if(p.Id("endif"))
ignore = false;
p.SkipLine();
}
else
if(p.IsId()) {
static Index<String> ds = { "DLOG", "DDUMP", "DDUMPC", "DDUMPM", "DTIMING",
"DLOGHEX", "DDUMPHEX", "DTIMESTOP", "DHITCOUNT" };
String id = p.ReadId();
if(ds.Find(id) >= 0 && p.Char('(') && !ignore) {
String line;
for(const char *s = pos.lineptr; findarg(*s, '\0', '\r', '\n') < 0; s++)
line.Cat(*s);
AddFoundFile(fn, pos.line, line, pos.ptr - pos.lineptr, id.GetCount());
}
}
else
p.Skip();
}
}
catch(CParser::Error) {}
}
}
/*
FileIn in(fn);
int line = 0;
while(!in.IsEof()) {
@ -590,6 +623,7 @@ void Ide::FindDs(int where)
catch(CParser::Error) {}
}
}
*/
FFoundFinish();
}

View file

@ -223,7 +223,7 @@ void Ide::IdeSetDebugPos(const String& file, int line, const Image& img, int i)
posline[i] = line;
posimg[i] = img;
EditFile(file);
editor.GotoLine(line);
editor.GotoBarLine(line);
PosSync();
Size sz = editor.GetPageSize();
Point p = editor.GetScrollPos();

View file

@ -18,20 +18,27 @@ bool PPMRaster::Create()
}
try {
if(stream.GetLine() != "P6")
if(stream.Get(2) != "P6")
return false;
String h = stream.GetLine();
CParser p(h);
size.cx = p.ReadInt();
size.cy = p.ReadInt();
if(size.cx <= 0 || size.cx > 99999 || size.cy <= 0 || size.cy >= 99999)
return false;
h = stream.GetLine();
CParser p1(h);
int maxval = p1.ReadInt();
if(maxval <= 0 || maxval > 65535)
return false;
is16 = maxval > 255;
int ii = 0;
int num[3];
String line;
CParser p(line);
while(ii < 3) {
while(p.IsEof() || p.Char('#')) {
if(stream.IsEof())
return false;
line = stream.GetLine();
p.Set(line);
}
int n = p.ReadInt();
if(n <= 0 || n > 65535)
return false;
num[ii++] = n;
}
size.cx = num[0];
size.cy = num[1];
is16 = num[2] > 255;
pixel_pos = stream.GetPos();
return true;
}