Does command 4165 work properly?

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 84
Joined: Wed Jan 27, 2016 6:53 pm
Location: Europe

Does command 4165 work properly?

Post by SaFeTyPe »

I wanted to ask if anybody could please confirm that command 4165 works properly?

My understanding is that the difference between 4164 and 4165 is that
- 4164 will ALWAYS insert a tab (either to indent lines, or to enter "tab")
- 4165 will do NOTHING if just one line is selected (and it will indent / do "tab" when more than 1 line is selected.

However that does not work. 4165 works like 4164 for me.

Background: I wanted to make "indent lines" work with the NoOverwriteSelection plugin.

so I changed the code like this (I also allowed for alt-x to work)

Code: Select all


    if ((nCmd == 4155 /*IDM_EDIT_PASTE*/) ||
        (nCmd >= 4164) ||
        (nCmd >= 4166) ||
        (nCmd >= 4168) && (nCmd <= 4173 /*IDM_EDIT_DELETE_FIRST_CHAR_MENU*/) ||
        (nCmd >= 4175 /*IDM_EDIT_UPPERCASE*/)  && (nCmd <= 4180 /*IDM_EDIT_LOOPCASE*/) ||
        (nCmd == 4183 /*IDM_EDIT_INSERTDATE*/) ||
        (nCmd >= 4191 /*IDM_EDIT_PASTEANSI*/)  && (nCmd <= 4196 /*IDM_EDIT_AUTOINDENT*/))
    {
      if (AkelPad.GetSelStart() != AkelPad.GetSelEnd())
        AkelPad.WindowNoNextProc(hSubClassMain);
    }
  }

I was assigning Ctrl-T to 4165 then.

References:
http://akelpad.sourceforge.net/forum/vi ... hp?p=30483

Offline
Site Admin
Posts: 6411
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

(nCmd == 4164) ||
(nCmd == 4166) ||

Offline
Posts: 84
Joined: Wed Jan 27, 2016 6:53 pm
Location: Europe

Post by SaFeTyPe »

Hello and thank you, Instructor!

This fixed the problem for me! But it still overwrites single lines:

Thanks to your fix (stupid mistake of mine), I have now done the following:
1. changed >= to == in the script
2. assigned hotkey CTRL-ALT-T to command 4165 (and CTRL-SHIFT-ALT-T to 4167).

--> results:
- TAB does not delete text and does not indent text.
- CTRL-ALT-T behaves exactly like tab: it WILL delete text if it is a single line, and it WILL indent text if it is multiple lines.
- CTRL-ALT-T is much safer than TAB (one is much less likely to hit CTRL-ALT-T by mistake instead of TAB) ---> Problem is fixed for me! (I simply only allow CTRL-ALT-T in the NoOverwriteSelection script)
- However CTRL-ALT-T (command 4165) will still delete text.

4165 Insert tabulation only if several lines selected

For me, 4165 still works exactly like 4164.

I also tested it on Win 11 arm64 and Win 8.1 x64

I was expecting 4165 to NOT delete anything if less than one line is selected.
Post Reply