On Wed, Feb 03, 2016 at 09:22:19AM +0100, Silvan Jegen wrote:
> On Tue, Feb 2, 2016 at 11:18 PM, Marc André Tanner <m...@brain-dump.org> 
> wrote:
> > Instead of introducing these one should write a
> >
> >  Filerange text_object_filename(Text *txt, size_t pos)
> >
> > which would also take care of any needed offsets. Also I'm not sure
> > whether using the "customword" functions is a good idea due to their
> > behavior if you are already at the start/end of the word.
> 
> Yes, their behavior surprised me. I will look into implementing that function.

Well they also need to work if you are already on the first/last
character of a word which is not what you want in this case.

Checkout text_object_range it should apply to your use case.

> > Maybe the actual file opening should be implemented using the :edit
> > command via vis_cmd(...) this would also take care about detecting
> > unsaved changes etc.
> 
> That's what I wanted to do at first but then I saw that
> "info_unsaved_changes" would show "... (add ! to override)" which does
> not make sense. I will think about how to deal with that.

Then rename/export is_view_closeable from vis-cmds.c to something like
vis_window_closable and use it from main.c.

-- 
 Marc André Tanner >< http://www.brain-dump.org/ >< GPG key: 10C93617

Reply via email to