-
Notifications
You must be signed in to change notification settings - Fork 69
store/read user scripts relative to plugins config directory #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Please put on hold for the moment |
PythonScript/src/ConfigFile.cpp
Outdated
// Menu item | ||
if (0 == strcmp(element, "ITEM")) | ||
{ | ||
element = strtok_s(NULL, "/", &context); | ||
m_menuItems.push_back(tstring(WcharMbcsConverter::char2tchar(element).get())); | ||
m_menuScripts.push_back(tstring(WcharMbcsConverter::char2tchar(element).get())); | ||
if ((element[1] == ':') || (element[1] == '\\')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a check that item 1 of element exists and no null deref happens.
@ClaudiaFrank I will wait for your go. See my code comment. |
Yes, just unicode builds are currently done and therefore #define UNICODE is set in VS project. So the part inside of #ifdef UNICODE is used. We don't need to break the ANSI build from the else part within this commit. |
OK - will revert that part |
::ShellExecuteA(m_hNotepad, "open", helpFile.c_str(), NULL, NULL, SW_SHOWDEFAULT); | ||
helpFile = L"http://npppythonscript.sourceforge.net/docs/"; | ||
helpFile.append(WcharMbcsConverter::char2tchar(PYSCR_VERSION_STRING).get()); | ||
::ShellExecute(m_hNotepad, L"open", helpFile.c_str(), NULL, NULL, SW_SHOWNORMAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appending of the topic is not done here. Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of the old (1.0.8) online help which can't be used anyway as it isn't setup for
versions > 1.0.8, therefore I haven't done anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bruderstein Any plans to update the webpage at sourceforge? Or do you want to shift it to e.g. https://pages.github.com/?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ClaudiaFrank Could this PR be merged now? Or is there something open? Could you please extend the description what else is fixed apart from #15.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite of a missing online html help webpage, it should be ready to merge.
Description extended.
PythonScript/src/HelpController.cpp
Outdated
DWORD cchOUT = 0; | ||
HRESULT res = ::AssocQueryString(ASSOCF_INIT_IGNOREUNKNOWN, ASSOCSTR_EXECUTABLE, L".html", NULL, pszOut, &cchOUT); | ||
if (res = S_FALSE) | ||
pszOut = new TCHAR[cchOUT]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curly braces are missing for this section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happens sometimes if a pythonista is trying to code in c++ ;-)
Will be fixed with next commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're talking about (what appears to be) the single-line-30 after the IF in line 29 above, then C/C++ doesn't require curly braces...(but I always use them)...but maybe the P.S. coding standard does before code is accepted? Also, what's the standard for number of spaces for a "tab"...above I think I see 8 (which no one really uses!) which leads me to believe that maybe there is really an actual tab character there...and this would disappoint me if THAT is the coding standard...until Notepad++ fully implements a tab-indent-space-align feature. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I would have put in the braces in first place you wouldn't have been confused - it is a
complete code block (11 lines) and afaik PS is following npp coding guidelines.
My tab width is set to 4 spaces (no replacement by 4 spaces) - it seems github uses
a width of 8 spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just used that to bring up wrapping single lines in braces...I like that..and a mention of what the coding standard for P.S. might be. Unfortunately, N++'s source is a real mess tab/spaces-wise, Tab characters always end up causing a source code mess in evolving projects with different contributors. Sorry to get this off the main track...Claudia, remember those "curlies" in the future! :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if an extension exists which allows to set the coding guidelines per project.
I haven't found one so far but to be honest, didn't really try hard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- editorconfig (https://editorconfig.org/) for a basic set of config parameters by the editor (for N++ https://github.com/editorconfig/editorconfig-notepad-plus-plus)
- uncrustify (http://uncrustify.sourceforge.net/) to change complete code base
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no sorry misunderstanding I'm looking for something more advanced like
checking if the function, class, variable names are correct or if braces are in place etc...
Something which basically double checks the npp coding styles AND for VS2017.
I'm honest, I'm using Visual Studio :-) to code python script plugin.
Run edit control converted to combobox - fixes issue #69
make last command stay in editbox
make edit control in combobox scrolling
Fixes #15, #98, #96, #78, #69