Coder Social home page Coder Social logo

Comments (5)

edreamleo avatar edreamleo commented on July 1, 2024

@boltex Perhaps this is the place for a general comment about supporting Leo commands. This comment applies to several other leoInteg issues.

Imo, the only way to support Leo's full complement of commands is to query Leo for the list of expanded and marked nodes, as well as c.p, the presently selected node.

Special cases for individual commands can not really ever be enough, because of Leo commands such as execute-script, which can trigger any importer, or any other code that can insert, delete, change or rearrange nodes. In such cases, it seems to me, leoInteg will be obliged to redraw the entire outline, presumably by asking Leo's bridge to describe the entire outline, including, as I say above, the list of expanded and marked nodes, as well as c.p, the presently selected node.

from leointeg.

boltex avatar boltex commented on July 1, 2024

@edreamleo Yep,. this was already started with #18 but I've made additions to this in the current work for the next 0.1.13 release.

When refreshing the tree, the nodes know if they're marked, clones , etc. and should propose commands that reflect that state. (right click on marked node to see 'unmark' instead of mark @files nodes show "refresh from disk" ,,

And for general states, after each command stack that finishes resolving, i call a debounced method to ask leo about the current selected node and Leo state in general to enable/disable commands and icons.:
(sample python below)
w_states["changed"] = self.commander.changed # 'dirty/changed' member
w_states["canUndo"] = self.commander.canUndo()
w_states["canRedo"] = self.commander.canRedo()
w_states["canDemote"] = self.commander.canDemote()
w_states["canDehoist"] = self.commander.canDehoist()

This will be apparent and usable in the next release. (or on the dev branch a bit later tonight)

from leointeg.

boltex avatar boltex commented on July 1, 2024

@edreamleo wrote:

, as well as c.p, the presently selected node.

I see what you mean now. Working on this aspect too now... thanks for pointing this out!

from leointeg.

edreamleo avatar edreamleo commented on July 1, 2024

@boltex You're welcome. The plan you propose seems good to me.

from leointeg.

edreamleo avatar edreamleo commented on July 1, 2024

@boltex As I have noted elsewhere, executing a recursive import script (in leoInteg) via Ctrl+B works. This indicates that leoInteg is mostly correct and complete.

from leointeg.

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.