notepad-plus-plus / notepad-plus-plus/notepad-plus-plus

When pasting code into a function it doesn't indent well.

Open
#5,923 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
29.4k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Description of the Issue

When I past code into a blank indented function it doesn't automatically indent

Steps to Reproduce the Issue

I have this empty function:

public function area_report()
{
       throw new Exception("Area report currently doesn't work");
}

and I paste this code into it below the throw new exception line:

if (isset($_GET['area']) && $_GET["area"] == "") {
	$query .= $GLOBALS['srbc_camps'] . ".area LIKE '%' ";
}
else {
	$values = array($_GET['area']);
	$query .= $GLOBALS['srbc_camps'] . ".area='%s' ";
}

It would be very nice if this indented properly.

Expected Behavior
public function area_report()
{
	throw new Exception("Area report currently doesn't work");
	if (isset($_GET['area']) && $_GET["area"] == "") {
	$query .= $GLOBALS['srbc_camps'] . ".area LIKE '%' ";
	}
	else {
	$values = array($_GET['area']);
		$query .= $GLOBALS['srbc_camps'] . ".area='%s' ";
	}
}
Actual Behavior
public function area_report()
{
	throw new Exception("Area report currently doesn't work");
	if (isset($_GET['area']) && $_GET["area"] == "") {
	$query .= $GLOBALS['srbc_camps'] . ".area LIKE '%' ";
}
else {
	$values = array($_GET['area']);
	$query .= $GLOBALS['srbc_camps'] . ".area='%s' ";
}
}
Debug Information

Notepad++ v7.7.1 (64-bit)
Build time : Jun 16 2019 - 21:24:47
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the paste operation in Notepad++ 7.7.1 on Windows using the PHP function and code shown in the issue. No source files, tests, or entry points are identified; done means pasted code receives consistent indentation while preserving the documented syntax structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, php
Domain
desktop, developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.