sieukrem / jn-npp-plugin Goto Github PK
View Code? Open in Web Editor NEWPlugin for Notepad++ allowing you to automate some tasks using JavaScript
Home Page: https://github.com/sieukrem/jn-npp-plugin/wiki
Plugin for Notepad++ allowing you to automate some tasks using JavaScript
Home Page: https://github.com/sieukrem/jn-npp-plugin/wiki
I am wondering if there should be a definition for the subject menu item in this file:
jn-npp-plugin/deploy/[Notepad++ Directory]/plugins/jN/includes/MenuCmds.js
Regards,
Frank
See context when using with Emment.:
eight04/jn-npp-emmet#1
Edit: this error exist in previous version NppScripting and Dialog.js file too (if someone still uses). Problem is IE browser >9, so if anyone use something newer then should change line ~20:
styles.styleSheet.cssText = this.cfg.css || '\nbody {overflow: auto;}\n';
to
styles.cssText = this.cfg.css || '\nbody {overflow: auto;}\n';
or
styles.textContent = this.cfg.css || '\nbody {overflow: auto;}\n';
Edit: now Emmet use own wraper for dialog, but problem exist for included Zen Coding.
why:
require(require.currentDir+"\lib\Library.js");
var Kernel32 = new Library("Kernel32.dll");
Kernel32.Define("GetModuleHandleW", "LPCTSTR");
hModule=Kernel32.GetModuleHandleW("hhctrl.ocx")
alert(hModule);
return 0?
no problem with f.e.:
hModule=Kernel32.GetModuleHandleW("Kernel32.dll")
Greetings!
How I can make a terminal window to launch and listen console apps directly trogth stdin, stdout, stderr?
The Win APIs e.g. CreateProcess requires using the records. Does jN supports them?
leave
Hi Eugen,
I would like to write a simple menu to list all dirty (edited and not saved)
files, but I can't make it. Is the current API provide to tell the status of a
file? Kindly request your advice how I can achieve this.
Thank you.
Benx
Original issue reported on code.google.com by [email protected]
on 24 Oct 2014 at 3:19
When i write to Editor.createDockable, it get the focus.
Do it is possible to avoid it and mantain focus in editor?
Do it is possible to change background-color in Dockable?
I had hoped x64 in 2.2.183 ;)
Use GlobalListener.addListener(yoursCfg); to add new event listener and GlobalListener.removeListener(yoursCfg); to remove your event listener
but i obtain a method not supported with removeListener.
You are planing a x64 version?
What steps will reproduce the problem?
1.Install jN 2.0.116
2.Double click on a word
What is the expected output? What do you see instead?
Highlight all occurrences of the selected word, even if part of a longer word,
like the screenshot. The screenshot is from another PC with Win 7 64bit,
Notepad++ 5.9.6.2, jN unknown version.
What version of the product are you using? On what operating system?
Win 7 64bit, Notepad++ 6.5.3, jN 2.0.116
Original issue reported on code.google.com by [email protected]
on 15 Jan 2014 at 9:00
Attachments:
How would you recommend using jN to delete the current line in the current view?
(I do this from Notepad++ using control-L. Can I also do this from jN?)
Regards,
Frank
I have modified Library.js:
What steps will reproduce the problem?
1. Install jN_2.0.116.zip
2. Restart Notepad++
3. Mark text using style 1
What is the expected output? What do you see instead?
Should see marked occurrences in navigation bar. but i do not see navigation
bar in the first place.
What version of the product are you using? On what operating system?
jN_2.0.116.zip, Notepad++ v6.5.2, wine in linux
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 25 Feb 2014 at 2:32
Attachments:
I am attempting to use the Sass-Auto-Compile.js include. However, the script is unable to run, giving the error The filename, directory name, or volume label syntax is incorrect.
This seems to indicate that the problem is arising from the fact that there are spaces in the path to my Notepad++ installation.
Is there a way to run a user script when Notepad++ starts?
If not, please consider adding this feature.
Thanks for creating the plugin!
What steps will reproduce the problem?
1. Have a checked in file
2. Start editing the file
3. Nothing happens
What is the expected output? What do you see instead?
Expected to auto-request checkout (like in VS), nothing happens
What version of the product are you using? On what operating system?
1.0.34
Please provide any additional information below.
It would also be nice to configure which menus appear (I only need the CC, I
don't really care about the rest).
Great PI!
Original issue reported on code.google.com by yfital
on 17 Jul 2013 at 12:57
I would to replace NppExec plugin.
Do it is possible to ShellExecute the current document and view STDOUT stream or DOS output in console?
I use x64 edition, gecko is installed. The only visible effect of your plugin is addition of its submeny into Plugins menu. Everything implemented in JS is missing.
alert([Editor.langs.length, Editor.currentView.lang])
I get "51,58" with JavaScript, and "51,57" with JSON.
NPP v6.8.8
jN v2.1.181
Npp+ crash silent with new 32bit version at the start.
For me only 2.182 work.
Again it support "Library" Unlike 64bit?
What is the recommended way to get user input?
I would like to give a prompt string and get user input.
Thanks again for creating the plugin.
Frank
Hi Eugen,
Do you know about the tool 'fixmyjs' (https://github.com/jshint/fixmyjs)?
It would be wonderful if the tools can auto fix my javascript (entire file or
selection text). It looks cool the demo of sublime plugin implementation
https://github.com/addyosmani/sublime-fixmyjs
Can fixmyjs port in jN? Or can you kindly give me some advices or hints how to
achieve it by using jN libs?
Appreciate.
Benx
Original issue reported on code.google.com by [email protected]
on 24 Oct 2014 at 3:40
I noticed that if you have DSPellCheck plugin running to highlight mispelled words, SmartHighlight will show all these on the side. I was wondering if this was intended, if so, is there a way to disable it?
It makes it hard to see the actual highlighting you want, when working with large files that have a lot of mis-spelled words in the comments.
Love the feature. Nice work.
I just copy pasted the example that is on the wiki, hit F5 and got the following error:
Exception thrown and not caught
I want to use scintilla to style text. If there is an easier way, I would love to know about it.
Hi,
Great simple plug-in... thanks.
I've been looking in your samples to try some code...
I wonder where I can get the list of all Properties and Methods
of the Editor object...
I want to use what is available there...
If not then I have to use Scintilla calls...
Thx again...
Original issue reported on code.google.com by [email protected]
on 24 Jan 2015 at 10:46
Let's use the Chakra (IE9+) engine if it's available.
See details here: http://stackoverflow.com/a/7168837/76173
Original issue reported on code.google.com by [email protected]
on 9 Dec 2013 at 12:41
What steps will reproduce the problem?
1. Install clean copy of Notepad++ (6.5.3)
2. Download and place jN.dll and the jN folder into C:\Program Files
(x86)\Notepad++\plugins
3. Open Notepad++
What is the expected output? What do you see instead?
Expected: Notepad++ opens without any error messages.
Actual: Following pop-up is displayed.
popup window title: "just crash in"
===
DSpellCheck.dll just crash in notify(SCNotification *notification):
notification->nmhdr.code == 1001
notification->nmhdr.hwndFrom == 263434
notification->nmhdr.idFrom == 0
===
Upon clicking the OK, the Notepad++ screen turns gray, Windows takes over and
after a few seconds, a pop up "Notepad++: a free (GNU) source code editor has
stopped workding. ... [Close program]".
What version of the product are you using? On what operating system?
Win 7
Notepad++ 6.5.3
jN 2.0.100
Original issue reported on code.google.com by [email protected]
on 14 Jan 2014 at 7:31
Hello,
I use Clearcase SCM which checkout a file on MODIFYATTEMPTRO. In column mode the event is fired for every line and I get the several checkout dialogs. Even in single line mode sometimes the event is fired twice. As workaround I changed the clearcase.js to:
var PendingCheckouts = {};
// Add handler to catch event if user tries to modify checked in file
// and allow him to check out it
GlobalListener.addListener({ MODIFYATTEMPTRO:function(v){
var file = getFile();
var version = null;
try{
version = helperCC.Version(file);
}catch(e){}
if (version == null || version.IsCheckedOut)// nothing to do from point of view of ClearCase
return;
if ( PendingCheckouts[file] )
return;
PendingCheckouts[file] = 1;
shell.run("cleardlg /checkout \""+file+'\"',0,1);
delete PendingCheckouts[file];
}});
Is there a better way?
I kind of didn't like the way the menus are arranged on jN since each script
creates a menu item on the menu bar. I initially worked around this by
disabling all scripts I didn't use, but I now think that it would be better to
put all menus under on menu item.
This is easy by creating a menu item called jN-Scripts or something and the
referencing the object in all scripts.
Original issue reported on code.google.com by [email protected]
on 6 Apr 2014 at 5:44
Currently if we set View.pos
and View.anchor
, the scroll bar remains its original position even if the caret is out of the window.
Can we have some API like View.scrollIntoView()
or View.scrollIntoViewIfNeeded()
? For example, with Ctrl-F, if the caret is out of window, NPP scrolls the scroll bar and put the matched line at the center of the window. With Ctrl-G, NPP scrolls the scroll bar and put the matched line at the top/bottom of the window.
I wanted to make a script that will fold all JSDoc comments in the file
currently edited, but it seems jN hasn't got API for this. Have I overlooked it?
Original issue reported on code.google.com by [email protected]
on 16 Sep 2014 at 6:51
i would to autocopy selection in clipboard.
i tryed:
UPDATEUI:function(v, pos, x){
if(SC_UPDATE_SELECTION){
if(currentView.selection!==""){
System.clipBoard = currentView.selection;
}
}
}
but how check SC_UPDATE_SELECTION?
p.s. x64 proceeds?
it would be the first x64 third party plugins.
How to scroll to bottom a Dialog({dockable:{docking:"bottom"}}?
Can you provide some pre-built releases in the repo or can Google Code still be used if not too out of date?
Move folder with JS part (/deploy/[Notepad++ Directory]/plugins/jN
) to separate repo
Make it a submodule
Merge with https://github.com/KOLANICH/jN-npp-scripts
Do it is possible to handle a before paste event?
When input abbreviation like 'span{hello}' and then run the menu Expand
Abbreviation or shortcut [Ctrl + E], it doesn't not work.
It should output '<span>hello</span>', but nothing happened. It's still
'span{hello}'.
My Notepad++ version is 6.6.9, and jN plugin is 2.0.122. My OS is Windows 8.
Original issue reported on code.google.com by [email protected]
on 14 Oct 2014 at 11:23
for security some plugins directory is in %APPDATA%\Notepad++\plugins
not in C:\Program Files\Notepad++\plugins
so...
Editor.nppDir+"\Plugins\jN\includes"
In some cases, wrong.
Does onbeforeclose get triggered asynchronously from IDialog.close()?
If I insert an alert after close() then everything runs fine.
Is there anyway I can force it to be synchronous if it is in fact async?
What steps will reproduce the problem?
1. install jN plugins package
2. open a file with customed suffix like '.jsxxx'
3. toggle tab to the file
What is the expected output?
error message 'Editor.langs[..] is null or not an object' shown on a dialog
What version of the product are you using? On what operating system?
npp 5.9.8
jN 1.0.34
I tried to debug this issue and find the problem.
jN plugin XML.js will cause this issue at line 4.
script snippet:
this.menu.disabled = langs[v.lang].toLowerCase()!="xml";
while file type not in langs list, the langs[v.lang] means undefined, so it is
no method 'toLowerCase'.
I modified the line.
script snippet:
this.menu.disabled = !langs[v.lang] || (langs[v.lang] &&
langs[v.lang].toLowerCase() != "xml");
then it works.
Original issue reported on code.google.com by [email protected]
on 11 Oct 2013 at 7:29
The API link http://jn-npp-plugin.googlecode.com/svn/wiki/API/api.xml is not working.
This is more of a discussion starter than an issue.
I am really thankful that you chose to continue developing this plugin. I find
the ClearCase scripting functionality really useful.
However, as I work mainly with snapshot views, the base Clearcase.js file is
not working for me.
I found a version for snapshot views here:
http://sourceforge.net/p/notepad-plus/discussion/482781/thread/b83fde50
I took that as a baseline, added "Open previous version" and "Find checkouts"
menu items, made sure all of them work on snapshot views and added keyboard
hints, so you could check out a file by Pressing Alt+a, o.
Here is what I've got, maybe someone would find it useful:
https://gist.github.com/anonymous/5c2cb5d8271e2faee5f0
The question I have is:
What are your thoughts on integrating both versions, for dynamic and snapshot
views?
I see both of them share a lot of common code, would it make sense to detect if
the file is in a dynamic view, and activate the dynamic functionality, or a
snapshot view, and activating the alternative implementation.
I am willing to investigate if the above is possible, but I don't have an easy
way to debug what I'm writing. Do you have any hints on how I could easily
debug the scripts?
Thank you,
Arcadie.
Original issue reported on code.google.com by [email protected]
on 1 Mar 2013 at 10:38
Attachments:
What steps will reproduce the problem?
1. Download fresh version
http://download.tuxfamily.org/notepadplus/6.5.3/npp.6.5.3.bin.zip
http://code.google.com/p/jn-npp-plugin/downloads/detail?name=jN_2.0.100.zip
2. Unpack file and move jN folder and jN.dll to NPP\plugins
3. Run (as Administrator) NPP and immediately get crash.
What is the expected output? What do you see instead?
Working NPP but get Error dialog from Window.
What version of the product are you using? On what operating system?
Win7 64bit and IE11, last version NPP (portable) and jN
Please provide any additional information below.
I delete all other .dll plugin and all unnecessary script in jN but problem
still exist. I search all my disk and don't find NppDump.dmp file. I remember
that earlier version don't have any problem.
Problem is jN.dll, because if I delete this file all works fine.
Original issue reported on code.google.com by [email protected]
on 15 Jan 2014 at 12:41
What steps will reproduce the problem?
1. In a JavaScript extension, put some text on the clipboard. Example:
clipBoard = "clip test";
2. In Notepad++, do a paste. The text appears in the current view.
3. In a Chrome field, do a paste. The text appears in the field.
4. In Notepad, do a paste. The text appears in the view.
5. In a Firefox field, do a paste. Some text appears in the field, but not the
correct text.
Note. If I use the Edit > Copy from Notepad++, and then paste into a Firefox
field, the text appears in the field properly.
What is the expected output? What do you see instead?
I expect the text I place on the clipboard using JavaScript in a jN extension
to be the text pasted into other programs. This works with several programs,
but not with Firefox.
What version of the product are you using? On what operating system?
Version 2.0.146
Windows 7 64-bit
Please provide any additional information below.
Thanks for creating jn-npp-plugin. It is a nice tool.
Original issue reported on code.google.com by [email protected]
on 16 Jan 2015 at 3:46
Do it is possible to launch a chm file and find a keyword with internal Scintilla or activex control?
I tryed this attempt:
`
require("User32.dll.js");
require("Kernel32.dll.js");
var bMaximize=true;
var bCatchEsc=false;
ChmKeyword("c:\AutoIt.chm", "MsgBox");
function ChmKeyword(pFile, pKeyword)
{
var _TSTR=0, _TSIZE=1;
var hModule;
var hWndHelpList=0;
var hWndHelpChild;
var hWndHelpFocus;
var dwCurThreadID;
var dwHelpThreadID;
var hHook;
var hMutex;
//Load library manually to prevent hhctrl.ocx unload after HtmlHelp call
var Kernel32 = new Library("Kernel32.dll");
var User32 = new Library("User32.dll");
if (!(hModule=Kernel32.GetModuleHandle("hhctrl.ocx")))
hModule=Kernel32.GetModuleHandle("hhctrl.ocx");
if (hModule)
{
var lpKeywordBuffer=User32.NativeLibrary.alloc(256 * _TSIZE);
if (lpKeywordBuffer)
{
User32.NativeLibrary.writeByte(lpKeywordBuffer, pKeyword.substr(0, 255), _TSTR);
var lpStructure=User32.NativeLibrary.alloc(_X64?56:32);//sizeof(HH_AKLINK)
if (lpStructure)
{
//Fill structure
User32.NativeLibrary.writeByte(lpStructure, _X64?56:32, 3 /*DT_DWORD*/);//HH_AKLINK.cbStruct
User32.NativeLibrary.writeByte(lpStructure + (_X64?8:8), lpKeywordBuffer, 2 /*DT_QWORD*/); //HH_AKLINK.pszKeywords
User32.NativeLibrary.writeByte(lpStructure + (_X64?48:28), true, 3 /*DT_DWORD*/); //HH_AKLINK.fIndexOnFail
hWndHelpDlg=hModule.HtmlHelp(User32.GetDesktopWindow(), pFile, 0xD /*HH_KEYWORD_LOOKUP*/, lpStructure);
//Send VK_RETURN
if (hWndHelpDlg)
{
dwCurThreadID=Kernel32.GetCurrentThreadId();
dwHelpThreadID=User32.GetWindowThreadProcessId(hWndHelpDlg, 0);
if (pKeyword)
{
if (User32.AttachThreadInput(dwCurThreadID, dwHelpThreadID, true))
{
hWndHelpFocus=User32.GetFocus();
if (User32.GetWindowTextLength(hWndHelpFocus))
{
User32.SendMessageW(hWndHelpFocus, 0x0100 /*WM_KEYDOWN*/, 0x0D /*VK_RETURN*/, 0x011C001);
User32.SendMessageW(hWndHelpFocus, 0x0101 /*WM_KEYUP*/, 0x0D /*VK_RETURN*/, 0xC11C001);
}
else User32.SetWindowText(hWndHelpFocus, lpKeywordBuffer);
User32.AttachThreadInput(dwCurThreadID, dwHelpThreadID, false);
}
}
if (bMaximize)
{
//Maximize CHM window
User32.ShowWindow(hWndHelpDlg, 3);//SW_MAXIMIZE
}
/*
if (bCatchEsc)
{
if (hMutex=Kernel32.CreateEvent(0, 0, 0, WScript.ScriptName))
{
//Allow WindowSubClass and ThreadHook only for single script
if (oSys.GetLastError() != 183)//ERROR_ALREADY_EXISTS
{
//Catch WM_CLOSE
if (AkelPad.WindowSubClass(hWndHelpDlg, SubClassCallback, 2)) //WM_DESTROY
{
//Catch VK_ESCAPE
if (hHook=AkelPad.ThreadHook(3, HookCallback, dwHelpThreadID))//WH_GETMESSAGE
{
//Allow other scripts running
AkelPad.ScriptNoMutex();
//Message loop
AkelPad.WindowGetMessage();
//Wait while CHM window complitelly destroyed
for (nTimeOut=5000; nTimeOut > 0 && oSys.Call("user32::IsWindow", hWndHelpDlg); nTimeOut-=100)
WScript.Sleep(100);
AkelPad.ThreadUnhook(hHook);
}
AkelPad.WindowUnsubClass(hWndHelpDlg);
}
}
oSys.Call("kernel32::CloseHandle", hMutex);
}
}
*/
}
User32.NativeLibrary.free(lpStructure);
}
User32.NativeLibrary.free(lpKeywordBuffer);
}
}
}
`
All scripts has own menu (in old style) so we can't add his options to NPP context menu or run them with other plugins. I test Zen Coding without any positive results:
npp_menucommand Zen Coding|Wrap With Abbreviationd
, find this item but not invokenotepad.runMenuCommand('Zen Coding', 'Wrap with Abbreviation')
, like above, find this item but not invokecontextMenu.xml
file without successThe only solution what I found is write script for WSH (.js or .vbs) with send keys (shortcut for Zen Coding commands) and run this script with above tools. But it needs to define shortcut for any actions or other scripts (created via jN) which is inconvenient. This script can be add to Npp context menu and works.
Any advice how can I solve this in a more comfortable way?
When you store string settings with GlobalSettings.set() if it contains
backslashes then it get altered when you get it back and if it has a trailing
backslash then you get one or more error message :
name=SyntaxError
message='}' attendu
number=-2146827279
description='}' attendu
It can be solved with a small update in start.js but I am unsure it does not
have consequences elsewhere.
In function Settings()
add
var reg2 = /\\/g;
and replace
str.replace(reg, '\\"')
by
str.replace(reg2, '\\\\').replace(reg, '\\"')
Original issue reported on code.google.com by [email protected]
on 18 Apr 2013 at 6:04
Where to find the jN API document?
http://jn-npp-plugin.googlecode.com/svn/wiki/API/api.xml is 404
What steps will reproduce the problem?
1.
register .net activeX:
regasm.exe activexposhv3.dll /tlb /verbose
2.
invoke jScript via command line as:
cscript ActiveXposhV3.js
content of ActiveXposhV3.js:
var ActiveXPosh = new ActiveXObject("SAPIEN.ActiveXPoSHV3");
ActiveXPosh.Init(false);
ActiveXPosh.Execute("Get-Process");
result:
successful with list of process
3.
call it by jn-npp-plugin:
try {
var ActiveXPosh = new ActiveXObject("SAPIEN.ActiveXPoSHV3");
ActiveXPosh.Init(false);
var ddd = ActiveXPosh.Execute("Get-Process");
alert(ddd);
} catch (e) {
alert(e);
}
result:
Error: Automation server can't create object
What is the expected output? What do you see instead?
it should have outputted the list of process, but instead displayed as "Error:
Automation server can't create object "
What version of the product are you using? On what operating system?
notepad++ 6.6.9
jn-npp-plugin Version 2.0.146
on windows 8 64bit
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 2 Jan 2015 at 7:31
What steps will reproduce the problem?
1. install jN.zip to npp dir
2. run npp
What is the expected output? What do you see instead?
npp alert:
"Syntax error
line: 1, pos: 1
"
What version of the product are you using? On what operating system?
npp version v5.9.8
jN version 1.0.34
win xp sp3 x86
I try to debug the "start.js" file at "/nppdir/plugins/jN/",
it seems the code "addScript(scr);" will occur this problem.
cause some js code like "(function(){...})()", it looks the plugin not support
the syntax
Original issue reported on code.google.com by [email protected]
on 24 Sep 2013 at 6:11
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.