GithubHelp home page GithubHelp logo

ffes / indentbyfold Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 15.0 130 KB

IndentByFold Notepad++ plugin

License: GNU General Public License v2.0

C++ 26.33% C 70.31% Makefile 1.76% Batchfile 0.57% Shell 1.04%

indentbyfold's Introduction

indentbyfold's People

Contributors

chcg avatar ffes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

indentbyfold's Issues

If else problem with UDL

Hey!
I have a problem with the feature You call middle folding point.
I use { } as folding separators and use fold by indent plugin to format the code.

However if two separators are on the same line,
due to the 'middle folding point' the code does not format properly.
(Because the folder is now ending one line higher).

Example output:

if{
smt0;
}

if{
smt1;   
} else {
smt2;
} 

Instead of:

if{
smt1;   
} else {
smt2;
}

I have written to UDL about this and they responed:

Hi Matt,

this feature can be blocked only by commenting out part of source code, and then recompiling. But even that wouldn't help much, because code format-er needs to know about "middle" folding points (which represent end of old block and start of the new block in the same line)

I'd recommend to contact author of "Indent by fold" plugin, and ask him to extend his plugin to cover this case.
Folding points in Scintilla are 32-bit integers, and "middle" folding points represent two 16-bit numbers. If I had to guess, I'd say plugin is ignoring upper 16-bits of "middle" folding point.

Best regards,
Loreia

So, maybe it is a bug that is easily fixable ?
Cheers!
:)

Please provide keyboard shortcut

Hello,

thank you for the good plugin!

Can someone implement a keyboard shortcut?
I think everybody would highly appreciate.

Thank you again.

Regards,
Filippo

Fold end on new line and un-indent

Is it possible to place the fold end on a new line and un-indent it? The fold end is auto-compleeted.

If I start a fold and enter I end with (| as cursor)

a {
  |}

I would like

a {
  |
}

Feature request: colorize area between brackets

Thank you very much for your plugin. I have an amazing (to me) idea to improve it which I hope you will consider.
How about colorize the background of every area defined by parenthesis ? This would help greatly when troubleshooting open loops etc
One pic is worth 1000 words:

image

Thanks!

Not reindenting complete file

Is it correct that Redentbyfiold, only redent's what is in view ?
If so can there be an option to redent complete file ?
If not why is my PHP file not redentend completely

Can I make my else {} move 1 tab less?

It looks like this right now:

if ($number == 1){
     echo 'test';
     } else {
     echo 'test0';
}

I want it like this:

if ($number == 1){
     echo 'test';
} else {
     echo 'test0';
}

Besides that, it works great :)

If Then Else in C gets indented wrong

void UART_puts(char *Output, unsigned int length)
{
	uint8_t i;
	for(int i=0;i<length;i++)
		Output[i] = UART_putc();
}

gets turned into

void UART_puts(char *Output, unsigned int length)
{
	uint8_t i;
	for(int i=0;i<length;i++)
	Output[i] = UART_putc();
}

Basically the same as issue #1 , but for C. whenever there is no curly braces around a piece of code it gets parsed as the top-level indentation, all that's needed is just some exceptions for the flow-control statements.

If Then Else in various langauges gets indented wrong

When using the plugin for lua it works nicely except for If Then Else blocks where

function onNodeConnectionChange(args)
    if entity.isInboundNodeConnected(0) then
        storage.inputOpen = entity.getInboundNodeLevel(0)
    else
        storage.inputOpen = true
    end
end

gets turned into

function onNodeConnectionChange(args)
    if entity.isInboundNodeConnected(0) then
        storage.inputOpen = entity.getInboundNodeLevel(0)
        else
        storage.inputOpen = true
    end
end

Please add an option to disable (by file extension if possible)

This plugin doesn't understand Python files at all, which is understandable, but the issue is that it completely freaks out when I'm editing a Python script so I have to uninstall the plugin and re-enable the default auto-indent feature to switch to Python editing and then do the reverse when changing back to a bracketed language. At least having an option to disable the plugin without uninstalling it would be nice, ideally it would detect .py files and use default auto-indent behavior for them.

JavaScript if else gets indented wrong

Basically the same as issue #1 and #2, but for JS.

function onNodeConnectionChange(args) {
    if (entity.isInboundNodeConnected(0)) {
        storage.inputOpen = entity.getInboundNodeLevel(0);
    } else {  // <--- Expected
        storage.inputOpen = true;
    };
};

get Reindented to:

function onNodeConnectionChange(args) {
    if (entity.isInboundNodeConnected(0)) {
        storage.inputOpen = entity.getInboundNodeLevel(0);
        } else {  // <--- Unexpected
        storage.inputOpen = true;
    };
};

Doesn't ignore // comments

I've tried out indentbyfold to format some C code and it is not ignoring comments such as //{
It treats it as if the code is real and indents the real code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.