pkulchenko / ZeroBranePackage

Packages for ZeroBrane Studio (https://studio.zerobrane.com)
MIT License
245 stars 149 forks source link

Todoall: Fixed and revised from #57 #58

Closed paul-reilly closed 6 years ago

paul-reilly commented 6 years ago

That's those issues fixed from #57 . Well, the whitespace one is fixed by avoiding whitespace in the patterns. It was indeed a difference in file length between the raw lua file read and the wx editor file length that was causing the bad positioning on first load.

I've changed the ignore logic so that the beginning of a path relative to the project can be used to ignore everything in it. Scanning non-project files that are open on load or closed is better now too, only project files remain opened on close now.

paul-reilly commented 6 years ago

Added 8d0778f ...I noticed that errors/warning were produced with new, unsaved files. I've fixed that and make it update the list on save (of new files).

pkulchenko commented 6 years ago

Sounds good; will merge after review.

I think this plugin (and its todo sibling) can be updated to use the tree control, similar to what's done for the Markers panel, as this allows for better organization and visibility of the presented items (and will also avoid the problem with the long filenames). It may also use the same mechanism with delayed updates to stay in sync with the editor content.

paul-reilly commented 6 years ago

Yes, that's a good idea. I'll have a look at that over the next undefined length of time, but I don't want to make any promises. It does sound look a good opportunity to get familiar with another wx control though.

pkulchenko commented 6 years ago

@paul-reilly, with the recent changes, do you get the area selected in the TODO "editor" after double clicking on one of the lines? It seems like the opening of the editor causes the TODO content to be re-done, which in turn moves the current cursor, thus leaving the selection on. I think the logic can be improved by checking if the current content is the same and not changing anything if that's the case.

Unfortunately, most of this is likely to go away if we switch to the TreeCtrl.

paul-reilly commented 6 years ago

Yes, I was seeing that. It was safe to remove onEditorFocusSet since the other events covered everything as far as I could think. SetEmptySelection gets rid of the selection issue, but you are right that a TreeCtrl would be better.

paul-reilly commented 6 years ago

edit: it's okay, I got it working. Now it's a bit buggy since the old updating and focus logic hasn't translated perfectly and it's a bit barebones still. But it works.


I've added a treeCtrl in a tree branch, but I'm wondering if you know why the Connect method is failing for the event? It's on line 193...

https://github.com/paul-reilly/ZeroBranePackage/blob/tree/todoall.lua

... uncommenting the function stops the plugin working. With this sorted, I'm the now standard 90% of the way there. :)

pkulchenko commented 6 years ago

@paul-reilly, yes, I probably looked at the updated copy as I don't see any issues with the event handler.

pkulchenko commented 6 years ago

@paul-reilly, is it ready to be merged or are you still working on the TreeCtrl-based one?

paul-reilly commented 6 years ago

@pkulchenko , sorry yes I am still working on the TreeCtrl-based version. I want to test it properly before making a pull request... will be in a couple of days. I'll close this and make a new one then.

pkulchenko commented 6 years ago

Sounds good; thanks for the update.