notepad-plus-plus icon indicating copy to clipboard operation
notepad-plus-plus copied to clipboard

New line auto-indent does not work while recording a macro

Open ceeeb opened this issue 9 years ago • 6 comments

Tested in Notepad++ v6.9.2

OBSERVED: Generally, when user presses return to start new line from a line of text which is indented (by one or more presses of tab key), the new line inherits/copies the indent from the previous line. This is expected behaviour. However, if user is recording a macro, then presses return to start new line from a line of text which is indented, the new line starts without any indent.

EXPECTED: New lines should inherit the indent from the previous line in all circumstances. Recording a macro should not modify program behaviour.

TO REPRODUCE:

  1. Start new text file.
  2. Press tab to indent.
  3. Type some text.
  4. Press return. Observe new line starts with the indent from the line above.
  5. Start recording a macro.
  6. The input cursor should be indented. Type some text.
  7. Press return. Observe new line starts without any indentation.

ceeeb avatar Jun 17 '16 23:06 ceeeb

reproduced in 7.3.3 a tricky workaround is to copy / paste the indentation within the macro

c3k avatar Apr 05 '17 07:04 c3k

Any movement on this bug? I'm having the same issue.

Note: In my personal case, I was wanting to make a macro that I realized is accomplished by turning on AutoComplete for { in the settings.

neocamel avatar Feb 05 '19 03:02 neocamel

Still a problem in v7.9. I hope this issue can be addressed some time soon!

aepshteyn avatar Nov 05 '20 01:11 aepshteyn

reproduced in 7.3.3 a tricky workaround is to copy / paste the indentation within the macro

This workaround works.

If anyone is interested how to record a macro that would respect the indentation do it like this:

  1. start recording the macro
  2. press home
  3. press shift + home
  4. press ctrl + c
  5. press end
  6. press enter
  7. press ctrl + v
  8. stop recording the macro and save

DobrCr avatar Nov 18 '20 11:11 DobrCr

I found the same issue.

Debug info

Notepad++ v8.1.9 (64-bit) Build time : Oct 21 2021 - 23:37:53 Path : C:\Program Files\Notepad++\notepad++.exe Command Line : "D:\Workspace\InputData.cpp" Admin mode : OFF Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 10 Pro (64-bit) OS Version : 2009 OS Build : 19043.1348 Current ANSI codepage : 1252 Plugins : mimeTools.dll NppConverter.dll NppExport.dll NppGTags.dll

iosifzota avatar Nov 12 '21 15:11 iosifzota

Still seems to be happening in 8.6.8

reproduced in 7.3.3 a tricky workaround is to copy / paste the indentation within the macro

This workaround works.

You can use the duplicate line functionality as an option that doesn't overwrite your clipboard.

  1. start recording the macro
  2. press CTRL + D
  3. press DOWN ARROW
  4. press END
  5. press SHIFT + HOME
  6. press DELETE
  7. . . . whatever you wanted to do after adding auto-indented line . . .
  8. stop recording the macro and save

Batophobia avatar Jun 20 '24 04:06 Batophobia