Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#595 Apply IDM_EDIT_UPPER(LOWER)CASE to word under cursor if no selection

Next_major_release
open
nobody
None
5
2014-08-28
2014-07-08
Ole Jungclaussen
No

Recommended by Andreas Jonsson, this is a double post of Feature-Ticket [#2461] (https://sourceforge.net/p/notepad-plus/feature-requests/2461/)

Current Status: If nothing is selected, the commands IDM_EDIT_UPPERCASE and IDM_EDIT_LOWERCASE are disabled.
Proposal: Enable both commands and apply them to the word currently under cursor if nothing is selected.

Code changes (based on 6.6.7):
rem Notepad_plus.cpp, 1734: enableCommand(IDM_EDIT_UPPERCASE, hasSelection, MENU);
rem Notepad_plus.cpp, 1735: enableCommand(IDM_EDIT_LOWERCASE, hasSelection, MENU);

ScintillaEditView.cpp, 2386, insert before:

if(1==strSize){
    int iPos   = execute(SCI_GETCURRENTPOS, 0, 0);
    int iStart = execute(SCI_WORDSTARTPOSITION, iPos, 1);
    int iEnd   = execute(SCI_WORDENDPOSITION, iPos, 1);

    if(iEnd <= iStart || iStart==iPos || iEnd==iPos);
    else{
        execute(SCI_SETSEL, iStart, iEnd);
        selectionStart = execute(SCI_GETSELECTIONSTART);
        selectionEnd   = execute(SCI_GETSELECTIONEND);
        strSize = ((selectionEnd > selectionStart)?(selectionEnd - selectionStart):(selectionStart - selectionEnd))+1;
    }
}

Related

Bugs: #2461

Discussion