GithubHelp home page GithubHelp logo

Comments (14)

irrationalistic avatar irrationalistic commented on May 18, 2024

Thanks!

So would it be a shortcut that you could hit on a line that would fold all nested (via indentation) lines below until one that is at the same level? Or are you thinking more globally?

from atom-tasks.

mlms13 avatar mlms13 commented on May 18, 2024

I was thinking more globally. Regardless of cursor position, you hit this shortcut and all completed tasks in the current file become folded.

from atom-tasks.

irrationalistic avatar irrationalistic commented on May 18, 2024

Only if they have child tasks? Just want to make sure I fully understand your goals!

from atom-tasks.

mlms13 avatar mlms13 commented on May 18, 2024

So here's the start of what I had in mind: mlms13@4f20cbe

The goal is just to find any (non-archived?) completed or cancelled task, and if it has sub-tasks (ie if it can be folded), fold it. Currently my code isn't particularly good because:

  • editor.foldBufferRow(lineNumber) will work its way to the top of the document until it finds something to fold, so my command ends up folding the entire document. 😞 Really, I need something like editor.foldBufferRowIfFoldable(lineNumber). As far as I can tell, Atom doesn't provide something like this (or even an easy way to check if a row is foldable), but I could probably make my own.
  • All of the logic for getting completed tasks is duplicated from taskArchive, so I'll turn that into a utility function that they can both use.
  • The keybinding is Mac-only and completely arbitrary at this point.

I'll probably keep poking around this evening. This is the first I've looked at the Atom API (or really coffeescript, for that matter), so feel free to give me pointers if you have them.

from atom-tasks.

irrationalistic avatar irrationalistic commented on May 18, 2024

That sounds like a good direction! I haven't had a chance to work through it myself, but you might check out the task completion part that reads up looking for all projects that the task is a part of. Reversing the logic slightly by seeking through from the top and finding all tasks with children. If all the children are complete you could select up to the bottom most child and fold that selection. Hopefully that helps a little!

from atom-tasks.

irrationalistic avatar irrationalistic commented on May 18, 2024

How's this going? I may take a crack at solving it as well!

from atom-tasks.

mlms13 avatar mlms13 commented on May 18, 2024

Don't let me hold you back if you're interested. :) I haven't looked at it much since Friday.

from atom-tasks.

irrationalistic avatar irrationalistic commented on May 18, 2024

Ok, no worries! I want to do some thinking/planning on it to make sure it makes sense, so I'll do that when I get a chance and keep you posted.

from atom-tasks.

mandel01 avatar mandel01 commented on May 18, 2024

FYI on "Folding Text", which includes both folding and filtering. Code is there but it is not open source as he intends to charge for product in the future. It requires the HTML-based FTML format and not simply text files, so I suspect it has limited utility for a text based list, but I thought I'd pass it along in case it was useful.

http://www.foldingtext.com/foldingtext-for-atom/
http://jessegrosjean.gitbooks.io/foldingtext-for-atom-user-s-guide/content/appendix_b_file_format.html

from atom-tasks.

irrationalistic avatar irrationalistic commented on May 18, 2024

That looks pretty fancy! Seems that he would have had to build an entirely custom view (not using the normal text editor view). Not sure we'd need to do anything that drastic, my hopes are to hook into native atom code folding! But thanks for passing that along, very cool :)

from atom-tasks.

mandel01 avatar mandel01 commented on May 18, 2024

I agree that it's overkill. For ideas only...

from atom-tasks.

irrationalistic avatar irrationalistic commented on May 18, 2024

So I just looked back into this and I found that atom has built in commands for collapse and expand parent. It seems to work in my task files, so does this do what you need? Try going to a task in a project and using the hotkeys alt-cmd-[ and alt-cmd-].

If, however, you mean to only fold up the completed/cancelled tasks under a given project, that's a different story and wouldn't be doable in this current structure. I'd have to build my own editor renderer on top of atoms (which relates to a couple of the other issues currently being discussed). For now, you'll just have to take advantage of the task-archiver!

from atom-tasks.

mlms13 avatar mlms13 commented on May 18, 2024

Yeah my goal was to collapse only the completed/cancelled tasks. I looked into this as well a few months ago, and I wasn't able to find a good way to tell Atom to collapse arbitrary rows. I'm happy to close this and live with archiving, since it's probably not worth the effort with Atom's current folding API.

from atom-tasks.

irrationalistic avatar irrationalistic commented on May 18, 2024

Thanks! I'm slowly exploring a re-write that replaces the text editor with a custom version that would allow us to do all sorts of fancy things, but is going to take a lot of work. We'll see how it goes!

from atom-tasks.

Related Issues (20)

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.