thehogfather / brackets-code-folding Goto Github PK
View Code? Open in Web Editor NEWCode folding extension for brackets IDE
Code folding extension for brackets IDE
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.
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.
Line numbers get messed up when cutting and pasting lines
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.
Noticed an issue where collapsing all items leaves the first item open.
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?
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.
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.
Is it possible to add support for those files ?
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).
I'm guessing this is similar to the issue already logged concerning italian and spanish keyboards ?
Thanks,
David
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?
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.
when lines are edited e.g., when braces are removed from a line, gutter still shows the fold marker
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.
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.
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.
brackets/test/smokes/citrus completed
<body>
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.
Cannot assign Alt-Cmd-C to codefolding.collapse. It is already assigned to com.uxentrik.CreateVarConsoleLogs
An alternative keyboard shortcut?
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.
The issue happens with some files... I haven't been able to pin point it to a size or anything, but this file will reproduce the issue.
https://github.com/MiguelCastillo/Brackets-Tern/blob/master/TernReferences.js
Load it up in Brackets and scroll down.
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. (:
test scenario
then collapse the ol element;
after that, try to use ALT + CTRL + L (beautify command)
you'll notice that the colapsed blocks will get expanded.
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.
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
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.
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>
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?
Would be very useful if there's a switch/case statement code folding feature as well, targeting the 'case [expr]:'
It is pretty difficult to expand/collapse lines right now. Consider making the collapse buttons a bit bigger
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.
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.
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
Can code folding be sticky (even if only across each session, not permenant)?
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.
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 :
Steps to reproduce:
(it is assumed that 'brackets-git' extension already installed)
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.
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");
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 Keyboard shortcut to fold the current code region nearest to the cursor.
To reproduce:
Result: Nothing happens
Result: The code region folded by the shortcut is folded again.
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.
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.
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.
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.
Folded code is sometimes expanded on save when right-trim extension is installed.
This shortcut:
KeyBindingManager.addBinding(EXPAND, "Ctrl-Alt-=");
makes impossible to write the ] symbol on Italian keyboards.
Could it be fixed? Thanks.
The extension is not working after latest update on mac atleast , not sure about other os.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.