ide: Assist fixed in macos

This commit is contained in:
Mirek Fidler 2023-04-09 11:45:41 +02:00
parent 18f898542e
commit df06295f95
6 changed files with 22 additions and 20 deletions

View file

@ -227,7 +227,9 @@ void Ctrl::GuiSleep(int ms)
{
ASSERT(IsMainThread());
sGuiSleep = true;
int n = LeaveGuiMutexAll();
GetNextEvent([NSDate dateWithTimeIntervalSinceNow:ms / 1000.0]);
EnterGuiMutex(n);
sGuiSleep = false;
}

View file

@ -290,7 +290,7 @@ void Ctrl::SetNSAppImage(const Image& img)
void Ctrl::SetMouseCursor(const Image& img)
{
if(GetDragAndDropSource())
return;
return;
int64 h = img.GetAuxData();
if(h) {
[GetNSCursor(h) set];

View file

@ -1,6 +1,6 @@
#include "CtrlCore.h"
#define LLOG(x) // DLOG(x)
#define LLOG(x) // DLOG(x)
namespace Upp {

View file

@ -194,7 +194,6 @@ void RichPara::Paint(PageDraw& pw, RichContext rc, const PaintInfo& pi,
pi.DrawSelection(pw.Page(p), z * rc.page.left, top, z * rc.page.right - z * rc.page.left, bottom - top);
}
opy = rc.py;
int oi = 0;
int x = 0;
int y0 = 0;
int lineascent = 0;
@ -375,8 +374,6 @@ void RichPara::Paint(PageDraw& pw, RichContext rc, const PaintInfo& pi,
}
else
while(i < ilim) {
if(hg->object)
oi++;
i++;
hg++;
}

View file

@ -80,6 +80,7 @@ bool Clang::Parse(const String& filename_, const String& content,
dword options,
const String& filename2, const String& content2)
{
LLOG("Parse " << filename_);
if(!HasLibClang())
return false;
@ -88,25 +89,12 @@ bool Clang::Parse(const String& filename_, const String& content,
Dispose();
String cmdline;
String filename = filename_;
if((options & PARSE_FILE) && GetFileExt(filename) == ".icpp") {
String src = "#include \"" + filename + "\"";
filename = CacheFile(GetFileName(filename) + "$" + SHA1String(src) + ".cpp");
SaveChangedFile(filename, src);
}
cmdline << filename << " -DflagDEBUG -DflagDEBUG_FULL -DflagMAIN -DflagCLANG ";
if(IsCppSourceFile(filename))
cmdline << " -std=c++14 -xc++ " << LibClangCommandLine() << " ";
else
cmdline << " -xc " << LibClangCommandLineC() << " ";
String cmdline0 = cmdline;
cmdline << RedefineMacros() << " ";
String includes = includes_;
MergeWith(includes, ";", GetClangInternalIncludes());
@ -124,6 +112,19 @@ bool Clang::Parse(const String& filename_, const String& content,
for(const String& s : Split(defines + ";CLANG", ';'))
args.Add("-D" + s);
String cmdline;
if(IsCppSourceFile(filename))
cmdline << " -std=c++14 -xc++ " << LibClangCommandLine() << " ";
else
cmdline << " -xc " << LibClangCommandLineC() << " ";
cmdline << " -DflagDEBUG -DflagDEBUG_FULL -DflagMAIN -DflagCLANG " << filename;
String cmdline0 = cmdline;
cmdline << RedefineMacros() << " ";
args.Append(Split(cmdline, ' '));
Vector<const char *> argv;
@ -142,7 +143,7 @@ bool Clang::Parse(const String& filename_, const String& content,
if(!tu)
PutAssist("Failed commandline: " + cmdline0);
// DumpDiagnostics(tu);
// Diagnostics(tu, VppLog());_DBG_
return tu;
}
@ -150,6 +151,8 @@ bool Clang::Parse(const String& filename_, const String& content,
bool Clang::ReParse(const String& filename, const String& content,
const String& filename2, const String& content2)
{
LLOG("ReParse " << filename);
if(!HasLibClang())
return false;

View file

@ -23,7 +23,7 @@ bool LoadLibClang0(const char *dir, const char *file)
bool LoadLibClang(const char *dir)
{
#ifdef PLATFORM_MACOS0 // it does not seem to work for some reason, block it for now
#ifdef PLATFORM_MACOS // it does not seem to work for some reason, block it for now
if(LoadLibClang0(dir, "libclang.dylib"))
return true;
#endif