• Create a Msg box in Notepad++ Macros

    Locked
    3
    1 Votes
    3 Posts
    4k Views
    Дмитрий Трошин194Д

    For text processing, I use the jN plug-in for Notepad ++.
    https://github.com/sieukrem/jn-npp-plugin
    But it allows you to process text in the editor using JavaScript.
    For example, cut lines longer than 300 characters:

    function InputBox(psTxt, psCapt, psVal) {
    var rv = psVal;
    var so = new ActiveXObject(“MSScriptControl.ScriptControl”);
    so.Language = ‘VBScript’;
    var vCode =
    ’ Function getInputNumber() \n’+
    ’ val = InputBox(“‘+psTxt+’”,“‘+psCapt+’”,“‘+psVal+’”) \n’+
    ’ getInputNumber = val \n’+
    ‘End Function \n’;
    so.AddCode(vCode);
    rv = parseInt(so.Run(“getInputNumber”));
    return rv;
    }

    // удаляем строки которые длинее n символов
    function rowsOverLengthRemote(psOper) {
    var vOLen = 300;
    if(!psOper) { psOper = 1; }
    vOLen = InputBox(‘Input length’,“For very long rows”,vOLen);
    vOLen = parseInt(vOLen);
    if(vOLen <= 40) {
    return;
    }
    // debugger;
    // return;
    var vTextAll = Editor.currentView.text;
    var vArr = vTextAll.split(‘\n’);
    var vTextNeed = ‘’;
    var vLine = ‘’;
    for(var i = 0; i<vArr.length; i++) {
    vLine = vArr[i];
    if(vLine.length <= vOLen) {
    vTextNeed = vTextNeed + ‘\n’ + vLine;
    } else {
    if(psOper == 2) {
    message(“Cut string N: “+i+’ length” ‘+vLine.length+’ >> ‘+vLine.substring(0, 500));
    vTextNeed = vTextNeed + ‘\n’ + vLine.substring(0,vOLen);
    } else if(psOper == 1) {
    message("Kill string N: "+i+’ length” ‘+vLine.length+’ >> '+vLine.substring(0, 500));
    }

    } } Editor.currentView.text = vTextNeed;

    }

    var myKillVeryLengthRows = {
    text: “Удалить строки длинее N \tCtrl+Shift+K”,
    ctrl: true, shift: true, alt: false,
    key: 0x4B, // “K key”
    cmd: rowsOverLengthRemote
    };

    addHotKey(myKillVeryLengthRows);
    scriptsMenu.addItem(myKillVeryLengthRows);

    function rowsOverLengthCut() { rowsOverLengthRemote(2); }
    var myCutVeryLengthRows = {
    text: "Обрезать строки длинее N ",
    cmd: rowsOverLengthCut
    };
    scriptsMenu.addItem(myCutVeryLengthRows);

    It also has the ability to display messages:

    JavaScript alert (‘Message’) status (‘Message’); - in the status bar N ++ message (“Message”) - output to the man-made message box (my development):
    http://prntscr.com/j6s9j9
  • Finding Matching Brackets

    4
    0 Votes
    4 Posts
    29k Views
    Scott SumnerS

    @linpengcheng said:

    real-time Matching Current Brackets block

    I think the OP is talking about a different use-case (“long file”, “whole file”) than what the script you pointed to provides. The script is for where the opening and closing delimiter are viewable simultaneously in an editing tab.

  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • How to automatically add space on both sides of the operator

    13
    0 Votes
    13 Posts
    7k Views
    Fahim AnwerF

    You could try to use “find and replace” feature, set to consider regular expressions, and replace all no-space (x) char with x followed a space in a current selection.

    Save it as a macro and apply in other parts of code.
    https://10bestgame.com/instagram-cool-captions/

  • Create a login to notepad++ like in google chrome

    2
    0 Votes
    2 Posts
    2k Views
    chcgC

    At least the settings could be already taken from a local sync folder of a cloud storage like e.g. dropbox, onedrive, … See settings->options->cloud

  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • Collapsed lines become visible when printed?

    Locked
    1
    0 Votes
    1 Posts
    834 Views
    No one has replied
  • Find function window

    Locked
    1
    1 Votes
    1 Posts
    696 Views
    No one has replied
  • How To Set-up Command Pr in Notepad++

    Locked
    1
    0 Votes
    1 Posts
    635 Views
    No one has replied
  • FIXED: Drag and drop files into Notepad++

    Locked
    1
    0 Votes
    1 Posts
    9k Views
    No one has replied
  • 3 Votes
    1 Posts
    915 Views
    No one has replied
  • False positive warning analysis ?

    2
    0 Votes
    2 Posts
    1k Views
    ChillerThonC

    image details about the file

  • File splitter Enhancement : to view big files

    Locked
    1
    0 Votes
    1 Posts
    780 Views
    No one has replied
  • A silly question...

    3
    0 Votes
    3 Posts
    2k Views
    chcgC

    Could you please add the debug information of N++. What kind of project do you compile and how? With the help of a N++ plugin?

  • Use of tab for white space

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Daniel RosenbergD

    Thanks so much. I never thought to look in the language settings, I was always looking in the edit settings.

    Happy Day!

  • Search for text in my tabs.

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Scott SumnerS

    @Bekno

    How about using the Find All in All Opened Documents button on the Find tab of the Find window??

    Of course, maybe your request makes more sense (as a new feature) if you are talking about limiting the search to open tabs that match a certain filespec…

  • Change style for PHP

    Locked
    1
    0 Votes
    1 Posts
    708 Views
    No one has replied
  • "Search Private" option on "Open" window disappeared.

    Locked
    1
    0 Votes
    1 Posts
    612 Views
    No one has replied
  • I need this

    Locked
    1
    0 Votes
    1 Posts
    703 Views
    No one has replied
  • Error message after trying to load huge file

    Locked
    2