Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Remove horizontal white space #15074

Open
1 task done
eaglebush opened this issue May 2, 2024 · 1 comment
Open
1 task done

[Feature request] Remove horizontal white space #15074

eaglebush opened this issue May 2, 2024 · 1 comment

Comments

@eaglebush
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

A feature on a selected text or whole text that removes extra white space characters inside the text or paragraph

Describe the solution you'd like.

Visual Studio 2022, perhaps as I discovered, has this feature that can remove extra white spaces inside a group of text or a paragraph. White spaces could be a series of spaces or a series of tab space. For instance, here is an SQL create table statement:

CREATE TABLE sample (
                    CostTierID        integer  null,
                    InvtTranKey       integer  not null,                    CostTierKey     integer not null Default 0,
                    WhseKey           integer  not null,                    ItemKey         integer not null,
                    EffectOnInvt      smallint not null,                    CostTierQty     decimal(16,8) not null,
                    ValuationMeth     smallint not null,                    NegCTFlag       smallint not null Default 0,
                    CostingDate       datetime not null,                    StockDate       datetime null,
                    TotMaterialCost   decimal(15,3) not null Default 0,     TotFreightCost  decimal(15,3) not null Default 0,
                    TotSTaxCost       decimal(15,3) not null Default 0,     TotOtherCost    decimal(15,3) not null Default 0,
                    TotRunFixCost     decimal(15,3) not null Default 0,     TotRunVarCost   decimal(15,3) not null Default 0,
                    TotSetFixCost     decimal(15,3) not null Default 0,     TotSetVarCost   decimal(15,3) not null Default 0,
                    TotOutsideCost    decimal(15,3) not null Default 0,     TotOtherMfgCost decimal(15,3) not null Default 0,
                    InvtLotKey        integer not null Default 0,           InvtSerialKey   integer not null Default 0
);

With Visual Studio 2022, I can just press a group of combination of key presses (Ctrl+K, Ctrl+ \), and this text would be cleaned of white spaces between words:

                CREATE TABLE sample (
CostTierID integer null,
InvtTranKey integer not null, CostTierKey integer not null Default 0,
WhseKey integer not null, ItemKey integer not null,
EffectOnInvt smallint not null, CostTierQty decimal(16,8) not null,
ValuationMeth smallint not null, NegCTFlag smallint not null Default 0,
CostingDate datetime not null, StockDate datetime null,
TotMaterialCost decimal(15,3) not null Default 0, TotFreightCost decimal(15,3) not null Default 0,
TotSTaxCost decimal(15,3) not null Default 0, TotOtherCost decimal(15,3) not null Default 0,
TotRunFixCost decimal(15,3) not null Default 0, TotRunVarCost decimal(15,3) not null Default 0,
TotSetFixCost decimal(15,3) not null Default 0, TotSetVarCost decimal(15,3) not null Default 0,
TotOutsideCost decimal(15,3) not null Default 0, TotOtherMfgCost decimal(15,3) not null Default 0,
InvtLotKey integer not null Default 0, InvtSerialKey integer not null Default 0
)",

A few adjustments of this would look like this:

CREATE TABLE sample (
    CostTierID integer null,
    InvtTranKey integer not null, CostTierKey integer not null Default 0,
    WhseKey integer not null, ItemKey integer not null,
    EffectOnInvt smallint not null, CostTierQty decimal(16,8) not null,
    ValuationMeth smallint not null, NegCTFlag smallint not null Default 0,
    CostingDate datetime not null, StockDate datetime null,
    TotMaterialCost decimal(15,3) not null Default 0, TotFreightCost decimal(15,3) not null Default 0,
    TotSTaxCost decimal(15,3) not null Default 0, TotOtherCost decimal(15,3) not null Default 0,
    TotRunFixCost decimal(15,3) not null Default 0, TotRunVarCost decimal(15,3) not null Default 0,
    TotSetFixCost decimal(15,3) not null Default 0, TotSetVarCost decimal(15,3) not null Default 0,
    TotOutsideCost decimal(15,3) not null Default 0, TotOtherMfgCost decimal(15,3) not null Default 0,
    InvtLotKey integer not null Default 0, InvtSerialKey integer not null Default 0
)

Here is what the menu looks like:

image

This feature would reduce mistakes removing white spaces by Del or Backspace strokes.

Debug Information

Notepad++ v8.6.5   (64-bit)
Build time : Mar 29 2024 - 17:04:43
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Pro (64-bit
OS Version : 23H2
OS Build : 22631.3447
Current ANSI codepage : 1252
Plugins : 
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)

Anything else?

No response

@CennoxX
Copy link
Contributor

CennoxX commented May 2, 2024

@eaglebush An easy solution for this would be to create a macro:
Macro > Start recording
make a selection, CTRL+H, Find what:"[ \t]+", Replace with:" ", In selection: checked, Search mode: Regular expression, Replace All
Macro > Stop recording
Macro > Save Currently Recorded Macro ... and give a name and shortcut you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants