Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
17 changes: 2 additions & 15 deletions LuaScript.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26430.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LuaScript", "src\LuaScript.vcxproj", "{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}"
ProjectSection(ProjectDependencies) = postProject
{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A} = {FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lua", "src\Lua.vcxproj", "{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -26,14 +21,6 @@ Global
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|Win32.Build.0 = Release|Win32
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.ActiveCfg = Release|x64
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.Build.0 = Release|x64
{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}.Debug|Win32.ActiveCfg = Debug|Win32
{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}.Debug|Win32.Build.0 = Debug|Win32
{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}.Debug|x64.ActiveCfg = Debug|x64
{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}.Debug|x64.Build.0 = Debug|x64
{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}.Release|Win32.ActiveCfg = Release|Win32
{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}.Release|Win32.Build.0 = Release|Win32
{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}.Release|x64.ActiveCfg = Release|x64
{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# GLua Script Environment for Notepad++

Check out Releases for a package. Contains GLuaScript (a fork of LuaScript NPP module), lua modules from [ZeroBraneStudio](https://studio.zerobrane.com/) editor for finding Garry's Mod and syntax highlighter from notepad++ plugins with updated rules from [here](https://raw.githubusercontent.com/robotboy655/robotboy655.github.io/master/GmodLua.xml).





___________


## Original text: ##


___________

# LuaScript
Notepad++ plugin for [Lua](http://www.lua.org/) scripting capabilities. This provides control over all of Scintilla's features and options with a light-weight, fully-functional programming language.

Expand Down
12 changes: 6 additions & 6 deletions src/Lua.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -84,29 +84,29 @@
<ProjectGuid>{FCFBB3B0-8628-4CD0-A9B7-1BFB34E31E2A}</ProjectGuid>
<RootNamespace>LuaScript</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand Down
33 changes: 20 additions & 13 deletions src/LuaScript.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -22,29 +22,29 @@
<ProjectGuid>{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}</ProjectGuid>
<RootNamespace>LuaScript</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand Down Expand Up @@ -108,7 +108,7 @@
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<AdditionalDependencies>Lua.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>x:\do\GMod\gbins\lua51\lua_shared.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These absolute x:\... paths make the project non-portable and will break builds on other machines/CI. Use a repo-relative path, an MSBuild property (e.g., $(SolutionDir), $(ProjectDir)), or an environment variable with a reasonable default so contributors can build without editing the project file.

Copilot uses AI. Check for mistakes.
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
Expand All @@ -121,7 +121,7 @@
<AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)_$(Platform)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>copy "$(TargetPath)" "C:\Program Files (x86)\Notepad++\plugins"</Command>
<Command>copy "$(TargetPath)" "x:\a\npp\plugins"</Command>

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These absolute x:\... paths make the project non-portable and will break builds on other machines/CI. Use a repo-relative path, an MSBuild property (e.g., $(SolutionDir), $(ProjectDir)), or an environment variable with a reasonable default so contributors can build without editing the project file.

Copilot uses AI. Check for mistakes.
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down Expand Up @@ -164,18 +164,18 @@
<Optimization>Disabled</Optimization>

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Debug configuration, using MultiThreaded (release CRT) instead of MultiThreadedDebug can cause CRT/heap mismatches and makes debugging harder (especially if any linked objects/libs use the debug CRT). If this is intentional, it should be clearly documented; otherwise, switch Debug back to the debug runtime or align the rest of the configuration accordingly.

Copilot uses AI. Check for mistakes.
<AdditionalIncludeDirectories>.\SciTE;.\lua\src;.\Dialogs;.\Npp;.\Utilities;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;WIN32;_DEBUG;_WINDOWS;_USRDLL;LuaScript_EXPORTS;__STDC_WANT_SECURE_LIB__=1;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Debug configuration, using MultiThreaded (release CRT) instead of MultiThreadedDebug can cause CRT/heap mismatches and makes debugging harder (especially if any linked objects/libs use the debug CRT). If this is intentional, it should be clearly documented; otherwise, switch Debug back to the debug runtime or align the rest of the configuration accordingly.

Suggested change
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>

Copilot uses AI. Check for mistakes.
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<SDLCheck>true</SDLCheck>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
<Link>
<AdditionalDependencies>Lua.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>x:\do\GMod\gbins\lua51\lua_shared.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)LuaScript.pdb</ProgramDatabaseFile>
Expand All @@ -187,7 +187,7 @@
<AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)_$(Platform)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>copy "$(TargetPath)" "C:\Program Files (x86)\Notepad++\plugins"</Command>
<Command>copy "$(TargetPath)" "x:\a\npp\plugins"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down Expand Up @@ -226,6 +226,13 @@
<ClCompile Include="Dialogs\StaticDialog.cpp" />
<ClCompile Include="IFaceTableMixer.cpp" />
<ClCompile Include="LuaConsole.cpp" />
<ClCompile Include="lua\src\compat-5.3.c" />
<ClCompile Include="lua\src\lbaselib.c" />
<ClCompile Include="lua\src\linit.c" />
<ClCompile Include="lua\src\liolib.c" />
<ClCompile Include="lua\src\lmathlib.c" />
<ClCompile Include="lua\src\loadlib.c" />
<ClCompile Include="lua\src\loslib.c" />
<ClCompile Include="NppExtensionAPI.cpp" />
<ClCompile Include="LuaScript.cpp" />
<ClCompile Include="NppIFaceTable.cpp" />
Expand Down
21 changes: 21 additions & 0 deletions src/LuaScript.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@
<ClCompile Include="LuaConsole.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lua\src\compat-5.3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lua\src\liolib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lua\src\linit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lua\src\lmathlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lua\src\loslib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lua\src\loadlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="lua\src\lbaselib.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Version.h">
Expand Down
2 changes: 2 additions & 0 deletions src/SciTE/LuaExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,8 @@ static bool InitGlobalScope() {

// ...register standard libraries
luaL_openlibs(luaState);
luaopen_base2(luaState);

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

luaopen_base2 returns 1 value (the library table) and this call path doesn’t pop it, which can leave unexpected stack junk during initialization. Also, calling both luaL_openlibs and luaL_openlibs2 risks registering overlapping libraries twice; consider using a single library-open path (or explicitly documenting/controlling the intended override order) and ensure the Lua stack is balanced after each call.

Suggested change
luaopen_base2(luaState);
luaopen_base2(luaState);
// luaopen_base2 pushes its library table; pop it to keep the stack balanced
lua_pop(luaState, 1);

Copilot uses AI. Check for mistakes.
luaL_openlibs2(luaState);

// override a library function whose default impl uses stdout
lua_register(luaState, "print", cf_global_print);
Expand Down
Loading