These are chat archives for nelsam/vidar

6th
Mar 2017
Kvaz1r
@Kvaz1r
Mar 06 2017 07:49
@nelsam , I build plugins branch. Works for old files. But for new does not see the command and does not display all menu buttons except the File.
And when press any of the menu options, the rest disappear.
Samuel Nelson
@nelsam
Mar 06 2017 08:15
that might be fixed, now
there were a bunch of bugs with my first attempt at hooks and plugins
there's still a bug when clicking on menu items (the editor loses focus, so it unbinds the commands, making the menu disappear)
I'm going to fix that soon, but it's actually more a bug with focus than with the plugin system
the way I see it, buttons shouldn't be granted focus - we should leave focus in the place where the keyboard cursor is
gxui has a more simple view of the world, though
I'll fix that as soon as I can
the reason that there's only a File menu on startup, now, is that commands that are under the other menus are only bound when a file is open - once a file is open, it should be happy
this is because it's silly to provide an Edit -> copy button if there's no text to copy, just like it's silly to provide a goimports command if you're in a .csv file
Kvaz1r
@Kvaz1r
Mar 06 2017 08:20
yes.
Samuel Nelson
@nelsam
Mar 06 2017 08:20
I spent the last couple of hours uncovering and fixing some of those bugs
I think it's in a better state now
Kvaz1r
@Kvaz1r
Mar 06 2017 08:20
but if need create new file and work with it, then in menu must be at least the option to save and continue working.
Samuel Nelson
@nelsam
Mar 06 2017 08:21
save should be there after you open a file
it just gets messed up when it loses focus
Kvaz1r
@Kvaz1r
Mar 06 2017 08:21
but now, even Ctrl+W not closing file
(only for new)
Samuel Nelson
@nelsam
Mar 06 2017 08:22
oooooh, I see the bug
okay, I think the latest commit will help
Samuel Nelson
@nelsam
Mar 06 2017 08:28
I missed one of the places where it opens files - it was still opening directly in the editor, rather than running the open-file command
only the open-file command can trigger hooks, which are what bind things like ctrl+w
Kvaz1r
@Kvaz1r
Mar 06 2017 08:33
yes. It works now
Samuel Nelson
@nelsam
Mar 06 2017 08:35
awesome
thanks for letting me know
I'm sure there are more bugs (actually I just found another one and fixed it), so I won't be merging that branch until I've had a chance to use it for quite a while
for now, I am going to sleep