GithubHelp home page GithubHelp logo

brackets-code-folding's People

Contributors

bbosman avatar codymaines avatar disshishkov avatar jjbocanegra avatar jkloss4 avatar joshkoshbgosh avatar lclzd avatar mikevalstar avatar rafaelcastrocouto avatar rainje avatar thehogfather avatar vadim-kudr avatar whaaaley 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brackets-code-folding's Issues

Broken in Edge Code

No longer works in Adobe Edge Code 0.97.0-359084144 as of 3/22.

Breaks on install: "Installation failed. The extension encountered an error while starting up."
Breaks on restart: "Extension error (remove)"

Tried with both the Extension Manager and Git download.

Not working in php and html code

first it's remarkable job thank you @thehogfather ๐Ÿ‘ .
second the extension is not working in html code with embedded php code can you fix Please the problem ? and i hope very soon
thank you in in advance.

Error when opening a non-foldable file

I've got a Developer Tools' Console in the background, and I noticed that when I open (in Brackets) a file with no folding fatures (for example a text file, or a Markdown file) I get the following exception in the console:

Uncaught TypeError: Cannot call method 'canFold' of undefined   main.js:109
_getCollapsibleLines                                            main.js:109
_decorateGutters                                                main.js:165
(anonymous function)                                            main.js:271

There's no lack of functionality, anyway.

Fold All does not fold inner regions

The Fold All command only folds the parent code blocks but does not go any deeper. Since most code has only a few main blocks (like html the tag or in js modules the define() line) it has no practical use. The main feature of a Fold All function should especially be to fold all the little blocks inside the main blocks. The Alt-Click function does fold the inner blocks of the selected block, so why not the Fold All function?

Support for 2 space width tabs

It is possible to set tab size in brackets but code folding is only visible av 4 spaces. Or have I missed the settings somewhere? I have tried to where it is set but haven't fold it.

JavaScript folding fails to load function but folds inner blocks

Folding was working fine until today. I do not know what has changed. I have uninstalled and reinstalled the folding plugin and I find that it seems to be having trouble. I wish I could be more specific.

Perhaps my source file, which is Parse Cloud Code, is getting too big and is causing trouble with this plugin. I will try breaking down the source file into pieces.

Unable to type "}" character when extension is installed

Started having this problem after updating to Sprint 34. I haven't noticed any other keys not working and updating my extensions.
I'm using a french keyboard where you need to press the ALT and = keys to type the character (image below).

sans titre-1

I'm guessing this is similar to the issue already logged concerning italian and spanish keyboards ?

Thanks,
David

Switching files with code folding enabled is very slow

With the code folding extension enabled, switching between various files in Brackets becomes much much slower. There's a very noticeable 500ms - 2s delay (depending on the size of the file). Almost as if code-foldering is re-calculating the code folding data on file focus.

If that's the case -- shouldn't it only be doing this once during file load, not on every file focus?

In other words -- is there any way to improve performance here?

Randomly folding

Hello

I have a small issue with your extension : it regularly folds part of the code, randomly and without any action from me.

It happens on all files (css, js, html) and apparently when I'm switching between files.

Collapse all / expand all and alt-click

At the moment collapse all and expand all only work in .css and .less files, but this feature would be useful in other file types if it worked as it does in native OS X apps.

For an example, alt/option-click an expander in Finder and all subfolders are expanded, too.

I'd find it useful to be able to do this in HTML files: for example, after alt-clicking <body> to collapse all sub items, re-expanding (without alt) would give an overview.

The Code Folding extension causes Brackets editor to become unresponsive

I just updated the Code Folding extension to its latest version and now when I start typing in the Brackets editor (i.e. edit HTML code) the editor becomes unresponsive for few seconds on each keystroke. I removed the Code Folding extension and the problem was not reproducible any more.

Tag range finder should ignore comments, as in brace range finder

At the moment, html code folding doesn't ignore tags in comments (e.g., <!-- <body> -->), which messes up code folding, causing tag mismatches. For a simple example, see the Brackets getting started example that comes with the app.

This isn't the case with files that use the brace range finder, so a simple solution would be to just ignore comments, like is done in that approach.

I'll submit a pull request if I get chance to look at the code in more detail.

Folding triangles should be visible in host editor when focus is in inline editor

  1. Install the brackets-code-folding extension
  2. File > Open Folder on brackets/test/smokes/citrus completed
  3. Open the index.html file - folding triangles appear
  4. Put the cursor inside the start tag <body>
  5. Cmd/Ctrl-E to open the inline editor

Actual result: The folding triangles in the full (outer) editor disappear. This is because the extension only shows folding triangles inside the active editor (which is now the inline editor).
Expected result: Folding triangles should be shown in all editors, both full editors and inline editors.

Alt-Cmd-C already used

Cannot assign Alt-Cmd-C to codefolding.collapse. It is already assigned to com.uxentrik.CreateVarConsoleLogs

An alternative keyboard shortcut?

Add a keyboard shortcut for faster folding

Just an idea. Would something like Ctrl+Shift+< and Ctrl+Shift+> to collapse either the element where the cursor is at or the area selected. I'd love to be able to collapse my p elements. I don't trust my own code yet, so I won't be the one to fork it.

Does not work w/ PHP files

Does not fold HTML code on a PHP file. This would be useful to add because lots of people use PHP's include to make HTML templates. Just a suggestion. (:

getFilenameExtension() API has been deprecated

Starting in Brackets Sprint 32, FileUtils.getFilenameExtension() is deprecated. It still works, but prints warnings to the console -- and may be removed in the future.

You could do a straightforward migration to the new FileUtils.getFileExtension() API. Or if you want to preserve compatibility with older Brackets / Edge Code releases you could use something like the approach here: peterflynn/svg-preview@b40b39b.

Comments screw up folding in HTML

This does not fold:
<div>
</div> <!-- comment -->

Probably an issue with only finding the end of the comment on the line and not recognizing the end-div

Problem if no open file

Hi.

I upgraded the code-folding extension to the latest version (0.0.5).

I noticed that if thers isn't any open file in Brackets I can't switch neither switch project nor open a new folder: nothing happens when I try to perform one of such actions. If I open a Console in the Developer Tools I see that I get an "Uncaught TypeError: Cannot call method 'lineCount' of null" in line 293 of main.js. If a file is open everything is ok.

I solved this problem modifying the _doSave function like this:

        function _doSave() {
            var editor = EditorManager.getCurrentFullEditor();
            if (editor) {
                saveLineFolds(editor);
            }
        }

Now everything's fine and I don't get errors.

Thank you for the attention.

Problems with XML-tags that have dots.

If there are dots in the tagnames in the XML-document only the last tag with a dot in it can be collapsed.

To reproduce: create an XML document that has the following content.

<a>

  <a.a>

  </a.a>

  <a.b>

  </a.b>
</a>

code folding persistence

This extension is absolutely needed for working with large files. Thank you for developing it. Would it be possible to store the state of the collapsed code sections upon save so when you save/close/reopen the document the elements are still collapsed?

Switch Statement Folding

Would be very useful if there's a switch/case statement code folding feature as well, targeting the 'case [expr]:'

close / open all folders

Is there a way to close or open all files at once?
If not, is it planned in a future release?

Anyway thank you for this plugin, it is very useful.

Support Folding Custom Regions with Line Comments

Would be very useful to have support for custom regions in Brackets.

With WebStorm, the IDE I currently use, you can surround a fragment of source code with line comments using either Visual Studio or NetBeans style folding markers

I use it a lot in js files that contain multiple classes or within a single class to mark different subject areas of code, like an 'init' region, a 'server' region etc.

Code folding fails to collapse code in haml and rb files correctly

Like stated in title. Updated to last version (which now allows to collapse code in ruby and haml files) and collapsing is not working correctly. Arrows appear in incorrect lines - it looks like these appear line before comment and line before code block in function

That's sample file (controller, pages_controller.rb) generated by rails g scaffold page

(I've added line numbers, to clarify where arrows are shown)

1 class PagesController < ApplicationController
2 before_action :set_page, only: [:show, :edit, :update, :destroy]
3 
4 # GET /pages
5   def index
6     @pages = Page.all
7   end
8
9   # GET /pages/:id
10   def show
11  end
12
13  # GET /pages/new
14  def new
15    @page = Page.new
16  end
17
18  # POST /pages
19  # POST /pages.json
20  def create
21    @page = Page.new(page_params)
22
23    respond_to do |format|
24      if @page.save
25        format.html { redirect_to page_path(@page.id), notice: 'Page was successfully created.' }
26        format.json { render action: 'show', status: :created, location: @page }
27      else
28        format.html { render action: 'new' }
29        format.json { render json: @page.errors, status: :unprocessable_entity }
30      end
31    end
32  end

Arrows appear only in lines
3 (blank line, before comment)
8 (blank line, before comment)
12 (blank line, before comment)
17 (blank line, before comment)
22 (blank line, before code block)
23 (code block, correctly)
24 (code block, correctly)
27 (code block, correctly)

Also, should appear in these lines
5, 14, 20 - functions

Also in .haml files when trying to collapse code, it collapse only part of a block, for example if structure looks like

%html
  %head
    %script 
  %body
    .first
    .second

    .third

When using arrow next to %body tag, it collapses all code until the empty line before .third tag

folding suggestion

Can code folding be sticky (even if only across each session, not permenant)?

Add a title field to your package.json

Right now, the "name" of your extension is showing up in the Extension Manager list: brackets-code-folding.

You can give it a nicer looking name by adding a "title" field to your package.json. Just give it a string value like "Code Folding" (or whatever) and that name will show up in the Extension manager list.

Code folding leaves some code at the top.

When folding the code, the arrow is positioned in wrong location, and thus does not folds the entire code, it leaves some code at the top. I believe this may be occurring because the extension must be folding from the line where opening brace ' { ' is placed and not from where the code actually starts.

To reproduce go to brackets>src>editor>ImageViewer.js:265
click on the code folding icon or use the shortcut to fold the ' if ' statement.
Screenshots :
code-folding-wrong-position
first-line left

git commiting unfold folded items.

Steps to reproduce:
(it is assumed that 'brackets-git' extension already installed)

  1. fold some items
  2. add some changes to file
  3. open brackets-git
  4. select there file
  5. hit 'commit' button

Expected behaviour: nothing happened
Actual behaviour: every folded items became unfolded.

Notes:
It also happens if currently open any other file. But if open (and active) file had been changed and folded, you can see unfolding 'in real time'.
Not modified files not unfolds.
Steps 2 and 3 may been interchanged.

Maybe this bug refer to brackets-git, I dunno actually.

Slow performance

screen shot 2013-07-18 at 5 49 09 pm
When folding is on scrolling becomes drammatically slow. As you can see from profiler it is in _renderLineFoldMarkers

Shortcuts enhancement

In notepad++ the "Alt 1" and "Shift Alt 1" shortcuts are used to collapse all and expand all, is it possible to add those shortcuts here too?

Also (not important, just a detail) to expand, "Ctrl Alt =" is ok, but is it possible to add "Ctrl Alt +" too ? for those who use the numeric keypad.

I don't know how to submit code so here is what I use

KeyBindingManager.addBinding(COLLAPSE, "Ctrl-Alt--");
KeyBindingManager.addBinding(EXPAND, "Ctrl-Alt-=");
KeyBindingManager.addBinding(EXPAND, "Ctrl-Alt-+");
KeyBindingManager.addBinding(COLLAPSE_ALL, "Alt-1");
KeyBindingManager.addBinding(EXPAND_ALL, "Shift-Alt-1");

Feature Request: Menu items under edit edit menu and/or context menu

I am not very good at remembering all of the hotkeys so I like having help from the menu. I see there are options to fold and collapse all folds or within the current context. I find that folding with the current context likely works as intended but I would like to have it also folder blocks under the current context. One example is a JavaScript object which holds onto many functions which could be conveniently collapsed to just show the name for each function. That is how I like to organize code. Currently I manually go to each function and collapse it. It would be great collapse all folds in the current context where it wraps folds under the context not the block it is currently inside.

Does this make sense?

Code folding is broken after using Ctrl-Alt-- to fold a current region

Code folding is broken after using Keyboard shortcut to fold the current code region nearest to the cursor.

To reproduce:

  1. Open a file with foldable code regions.
  2. Navigate inside one of the code regions and press Ctrl-Alt-- to collapse the region.
  3. Navigate out of the region and click the gutter to fold a different region.

Result: Nothing happens

  1. Put the cursor back on the folded region and press Ctrl-Alt-+ (or click on the gutter for the folded region). This should expand that region.
  2. Click on the gutter for any other line in the file.

Result: The code region folded by the shortcut is folded again.

Attempting to register an already-registered command

Brackets S38 Git version.

Attempting to register an already-registered command: codefolding.collapse.all CommandManager.js:179
Attempting to register an already-registered command: codefolding.expand.all CommandManager.js:179
Attempting to register an already-registered command: codefolding.collapse CommandManager.js:179
Attempting to register an already-registered command: codefolding.expand CommandManager.js:179
MenuItem added with same id of existing MenuItem: view-menu-codefolding.collapse Menus.js:578
MenuItem added with same id of existing MenuItem: view-menu-codefolding.expand Menus.js:578
MenuItem added with same id of existing MenuItem: view-menu-codefolding.collapse.all Menus.js:578
MenuItem added with same id of existing MenuItem: view-menu-codefolding.expand.all Menus.js:578
Cannot assign Ctrl-Alt-C to codefolding.collapse. It is already assigned to codefolding.collapse KeyBindingManager.js:463
Cannot assign Ctrl-Alt-X to codefolding.expand. It is already assigned to codefolding.expand KeyBindingManager.js:463
Cannot assign Alt-1 to codefolding.collapse.all. It is already assigned to codefolding.collapse.all KeyBindingManager.js:463
Cannot assign Alt-Shift-1 to codefolding.expand.all. It is already assigned to codefolding.expand.all 

Can't type "]" character when extension is installed and active

Can't type "]" character when extension is installed and active.
I'm running Window 8.1 Pro in Spanish (Spain).

The character not being typed only occurs inside brackets when the extenion is installed and active. I've deleted all other extensions even reinstalled the last version and the bug still occurs.

Fold marker is a bit too big

In CSS files the fold marker needs to be a tad smaller or have some padding added to the right of it. It blocks about 2/3 of the first character of text.

I can see .CodeMirror-foldmarker is the selector I'm looking for, but I can't figure out where the change needs to be made. Changes in the main.less file in your plugin don't have any effect.

Use indentation for unsupported modes

Although not often enforced, most languages support/encourage you to indent your code in sensible ways. It would be great if code-folding was applied based on indentation for all un-supported languages.

Problem with Italian keyboard

This shortcut:

KeyBindingManager.addBinding(EXPAND, "Ctrl-Alt-=");

makes impossible to write the ] symbol on Italian keyboards.

Could it be fixed? Thanks.

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.