]> git.neil.brown.name Git - edlib.git/log
edlib.git
10 years agorender-complete: if at EOF, there won't be a string, so be careful.
NeilBrown [Fri, 27 Nov 2015 04:35:56 +0000 (15:35 +1100)]
render-complete: if at EOF, there won't be a string, so be careful.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoAdd notifier to non-home panes on a doc.
NeilBrown [Fri, 27 Nov 2015 04:21:01 +0000 (15:21 +1100)]
Add notifier to non-home panes on a doc.

Use this to clean up and install a new document when the old one dies.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agodoc_destroy: don't close the pane before sending the destroy message to it.
NeilBrown [Fri, 27 Nov 2015 04:20:22 +0000 (15:20 +1100)]
doc_destroy: don't close the pane before sending the destroy message to it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agodoc-dir: locate the editor before destroying the pane which lets us find it.
NeilBrown [Fri, 27 Nov 2015 04:18:29 +0000 (15:18 +1100)]
doc-dir: locate the editor before destroying the pane which lets us find it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoMake sure to initialize all 'cmd_info'.
NeilBrown [Fri, 27 Nov 2015 04:17:20 +0000 (15:17 +1100)]
Make sure to initialize all 'cmd_info'.

Missed this one.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc panes to have an allocated 'data'.
NeilBrown [Fri, 27 Nov 2015 02:05:49 +0000 (13:05 +1100)]
Change doc panes to have an allocated 'data'.

This allows us to store other stuff than just the document.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agodiscard doc_first_mark in favour of vmark_first.
NeilBrown [Fri, 27 Nov 2015 02:04:23 +0000 (13:04 +1100)]
discard doc_first_mark in favour of vmark_first.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange popup to store the doc rather than the pane for the temp document.
NeilBrown [Fri, 27 Nov 2015 01:55:27 +0000 (12:55 +1100)]
Change popup to store the doc rather than the pane for the temp document.

This makes it easier to eventually destroy.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agochange doc_new to return a doc.
NeilBrown [Fri, 27 Nov 2015 01:53:29 +0000 (12:53 +1100)]
change doc_new to return a doc.

some callers want to set the name, and that currently requires the actual doc.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoDiscard doc_get_pane() in favour of doc_from_pane()
NeilBrown [Fri, 27 Nov 2015 01:13:30 +0000 (12:13 +1100)]
Discard doc_get_pane() in favour of doc_from_pane()

The pane was (almost) never used other than to extract the document,
so just return the document.

This will allow us to change the ->data stored on a document pane.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoAdd 'void *misc' field to cmd_info
NeilBrown [Fri, 27 Nov 2015 01:05:10 +0000 (12:05 +1100)]
Add 'void *misc' field to cmd_info

Use this for passing the 'struct stat' for doc:same-file.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoGet rid of rl_mark and lots of casts.
NeilBrown [Fri, 27 Nov 2015 00:50:08 +0000 (11:50 +1100)]
Get rid of rl_mark and lots of casts.

Now that all marks have mdata, we don't need this extension.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoGet rid of 'struct point'.
NeilBrown [Fri, 27 Nov 2015 00:37:03 +0000 (11:37 +1100)]
Get rid of 'struct point'.

Just use 'struct mark' which now as a void* mdata for extension.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoMove size field from point to point->links.
NeilBrown [Fri, 27 Nov 2015 00:08:00 +0000 (11:08 +1100)]
Move size field from point to point->links.

Now a point is nearly the same as a mark.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove ->doc field from point.
NeilBrown [Fri, 27 Nov 2015 00:04:10 +0000 (11:04 +1100)]
Remove ->doc field from point.

No longer needed.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agouse doc_get_pane to find document in search functions.
NeilBrown [Fri, 27 Nov 2015 00:02:57 +0000 (11:02 +1100)]
use doc_get_pane to find document in search functions.

..because I don't want point to hold the doc anymore.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoin doc-dir we can use ->home->data to get document.
NeilBrown [Thu, 26 Nov 2015 23:58:44 +0000 (10:58 +1100)]
in doc-dir we can use ->home->data to get document.

And use ->mark to find point too.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agodoc_attr: pass pane instead of doc
NeilBrown [Thu, 26 Nov 2015 23:52:32 +0000 (10:52 +1100)]
doc_attr: pass pane instead of doc

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoPoint_notify_change: pass doc explicitly, don't use point.
NeilBrown [Thu, 26 Nov 2015 23:49:52 +0000 (10:49 +1100)]
Point_notify_change: pass doc explicitly, don't use point.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove use of point->doc from point fore/back to mark.
NeilBrown [Thu, 26 Nov 2015 23:48:11 +0000 (10:48 +1100)]
Remove use of point->doc from point fore/back to mark.

No longer needed.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove doc arg from doc_next_mark.
NeilBrown [Thu, 26 Nov 2015 23:46:05 +0000 (10:46 +1100)]
Remove doc arg from doc_next_mark.

It is no longer needed.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agotlist_for_each{,_entry}_continue* no longer need head of list.
NeilBrown [Thu, 26 Nov 2015 23:40:39 +0000 (10:40 +1100)]
tlist_for_each{,_entry}_continue* no longer need head of list.

We can use the type information to stop at the right place.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove unused function point_reset
NeilBrown [Thu, 26 Nov 2015 23:31:44 +0000 (10:31 +1100)]
Remove unused function point_reset

Signed-off-by: NeilBrown <neil@brown.name>
10 years agosimplify/improve mark-at-point functions.
NeilBrown [Thu, 26 Nov 2015 23:26:56 +0000 (10:26 +1100)]
simplify/improve mark-at-point functions.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoPass pane to doc_set_attr instead of using pt->doc;
NeilBrown [Thu, 26 Nov 2015 22:35:18 +0000 (09:35 +1100)]
Pass pane to doc_set_attr instead of using pt->doc;

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove ->owner field from point.
NeilBrown [Thu, 26 Nov 2015 22:18:49 +0000 (09:18 +1100)]
Remove ->owner field from point.

No longer needed.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoPoints: allocate list of links separately.
NeilBrown [Thu, 26 Nov 2015 22:10:16 +0000 (09:10 +1100)]
Points: allocate list of links separately.

It was just too much hassle having a single allocation and managing
a single pointer to a point.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove ci->pointp
NeilBrown [Thu, 26 Nov 2015 07:11:36 +0000 (18:11 +1100)]
Remove ci->pointp

Now completely gone.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointless doc and pointp from emacs_file_complete and emac_doc_complete
NeilBrown [Thu, 26 Nov 2015 07:07:12 +0000 (18:07 +1100)]
Remove pointless doc and pointp from emacs_file_complete and emac_doc_complete

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoemacs_findfile: use pane_attr_get instead of doc_attr.
NeilBrown [Thu, 26 Nov 2015 07:04:32 +0000 (18:04 +1100)]
emacs_findfile: use pane_attr_get instead of doc_attr.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoemacs_kill_doc - no pointp
NeilBrown [Thu, 26 Nov 2015 07:00:06 +0000 (18:00 +1100)]
emacs_kill_doc - no pointp

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove last pointp from render-lines
NeilBrown [Thu, 26 Nov 2015 06:57:59 +0000 (17:57 +1100)]
Remove last pointp from render-lines

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoStop using pointp for Move-View-Pos
NeilBrown [Thu, 26 Nov 2015 06:56:09 +0000 (17:56 +1100)]
Stop using pointp for Move-View-Pos

Signed-off-by: NeilBrown <neil@brown.name>
10 years agocomplete_return doesn't need pointp either.
NeilBrown [Thu, 26 Nov 2015 06:44:11 +0000 (17:44 +1100)]
complete_return doesn't need pointp either.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange complete_set_prefix to no need direct access to point/doc
NeilBrown [Thu, 26 Nov 2015 06:42:30 +0000 (17:42 +1100)]
Change complete_set_prefix to no need direct access to point/doc

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp usage from emacs insert/delete commands.
NeilBrown [Thu, 26 Nov 2015 06:21:06 +0000 (17:21 +1100)]
Remove pointp usage from emacs insert/delete commands.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp usage from a lot of Move-* calls.
NeilBrown [Thu, 26 Nov 2015 06:14:08 +0000 (17:14 +1100)]
Remove pointp usage from a lot of Move-* calls.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove doc arg from mark_to_mark.
NeilBrown [Thu, 26 Nov 2015 06:10:50 +0000 (17:10 +1100)]
Remove doc arg from mark_to_mark.

It isn't really neded.
We can easily remove doc from doc_next_mark_all() as it isn't used.
We can also have a version of doc_prev_mark_all() that only gets
called when we *know* there is a previos mark, as we do ni mark_to_mark.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoSend point as ci->mark for events from keyboard or mouse.
NeilBrown [Thu, 26 Nov 2015 05:52:43 +0000 (16:52 +1100)]
Send point as ci->mark for events from keyboard or mouse.

I am deprecating ->pointp, but sometimes I need that mark.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoDon't set pointp for "Replace"
NeilBrown [Thu, 26 Nov 2015 05:38:17 +0000 (16:38 +1100)]
Don't set pointp for "Replace"

no replace function uses it anymore.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange "Refresh" function to pass 'point' via ci->mark.
NeilBrown [Thu, 26 Nov 2015 05:10:15 +0000 (16:10 +1100)]
Change "Refresh" function to pass 'point' via ci->mark.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange render-line command to accept point in 'mark2' instead of 'ptp'.
NeilBrown [Thu, 26 Nov 2015 04:36:02 +0000 (15:36 +1100)]
Change render-line command to accept point in 'mark2' instead of 'ptp'.

And get rid of point pointp stuff.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp arg for render-line-prev
NeilBrown [Thu, 26 Nov 2015 04:22:10 +0000 (15:22 +1100)]
Remove pointp arg for render-line-prev

We only needed the doc, and we can get that from the pane.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoStop using pointp in text_reundo and text_replace.
NeilBrown [Thu, 26 Nov 2015 04:12:45 +0000 (15:12 +1100)]
Stop using pointp in text_reundo and text_replace.

use home->data and home->point instead.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agotext_reundo: rename 'm' to 'm2'.
NeilBrown [Thu, 26 Nov 2015 04:11:53 +0000 (15:11 +1100)]
text_reundo: rename 'm' to 'm2'.

I want to introduce a more global 'm'.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoMove final doc default actions from 'view' to 'doc'.
NeilBrown [Thu, 26 Nov 2015 03:58:06 +0000 (14:58 +1100)]
Move final doc default actions from 'view' to 'doc'.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoImprove default move-file
NeilBrown [Thu, 26 Nov 2015 03:50:46 +0000 (14:50 +1100)]
Improve default move-file

Instead of moving one char at a time, just jump to the right end.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoNow that move_X is in core-doc, remove the pointp references.
NeilBrown [Thu, 26 Nov 2015 03:39:01 +0000 (14:39 +1100)]
Now that move_X is in core-doc, remove the pointp references.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agomove simple word/char/eol/file movement from 'view' to 'doc'.
NeilBrown [Thu, 26 Nov 2015 03:34:01 +0000 (14:34 +1100)]
move simple word/char/eol/file movement from 'view' to 'doc'.

I think it makes more sense here.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoremove two pointp users from emacs-search.
NeilBrown [Thu, 26 Nov 2015 03:18:16 +0000 (14:18 +1100)]
remove two pointp users from emacs-search.

Just use doc_replace to trigger a refresh.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove render-dir and render-text
NeilBrown [Thu, 26 Nov 2015 02:16:28 +0000 (13:16 +1100)]
Remove render-dir and render-text

Increasingly dead-weight.  Now that we have render-lines and
render-format, these can go.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agouse doc_get_pane to get document for render-format movement.
NeilBrown [Thu, 26 Nov 2015 02:12:30 +0000 (13:12 +1100)]
use doc_get_pane to get document for render-format movement.

Removes another pointp user

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp from render_hex_eol.
NeilBrown [Thu, 26 Nov 2015 02:07:48 +0000 (13:07 +1100)]
Remove pointp from render_hex_eol.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse panes and marks to communicate with CountLines
NeilBrown [Thu, 26 Nov 2015 01:57:04 +0000 (12:57 +1100)]
Use panes and marks to communicate with CountLines

so no more pointp;

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoDo for dir_close what we did for docs_bury.
NeilBrown [Thu, 26 Nov 2015 01:46:23 +0000 (12:46 +1100)]
Do for dir_close what we did for docs_bury.

It really is the same thing.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp setting from mark_same_pane
NeilBrown [Thu, 26 Nov 2015 01:45:10 +0000 (12:45 +1100)]
Remove pointp setting from mark_same_pane

completely pointless

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp usage from text_save_file and text_get_str
NeilBrown [Thu, 26 Nov 2015 01:41:20 +0000 (12:41 +1100)]
Remove pointp usage from text_save_file and text_get_str

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoNotfiy:Replace doesn't need pointp any more.
NeilBrown [Thu, 26 Nov 2015 01:35:42 +0000 (12:35 +1100)]
Notfiy:Replace doesn't need pointp any more.

So discard it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse "Notify:Replace" for notifications.
NeilBrown [Thu, 26 Nov 2015 01:32:19 +0000 (12:32 +1100)]
Use "Notify:Replace" for notifications.

We currently use "Notify" both to make changes and to notify
of changes.
This can be confusion - they are different tasks needing different names.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agodocs_destroy - avoid pointp.
NeilBrown [Thu, 26 Nov 2015 01:25:26 +0000 (12:25 +1100)]
docs_destroy - avoid pointp.

Use doc_get_pane instead.

Maybe I should be sending a message....

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc:destroy to work with pane rather than point.
NeilBrown [Thu, 26 Nov 2015 01:09:15 +0000 (12:09 +1100)]
Change doc:destroy to work with pane rather than point.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pane_point.
NeilBrown [Thu, 26 Nov 2015 01:06:40 +0000 (12:06 +1100)]
Remove pane_point.

Only one called remains, so open-code it there.

That caller should eventually go too.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove dependence of search on pane_point.
NeilBrown [Thu, 26 Nov 2015 01:02:56 +0000 (12:02 +1100)]
Remove dependence of search on pane_point.

This requires PointDup being able to provide a simple mark,
and a new function to find the document pane.

Signed-off-by: NeilBrown <neil@brown.name>
10 years ago"Close" no longer needs pane_point.
NeilBrown [Thu, 26 Nov 2015 00:46:07 +0000 (11:46 +1100)]
"Close" no longer needs pane_point.

render_lines was the last users, and it now uses panes for vmarks.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange vmark functions to take a pane instead of a document.
NeilBrown [Thu, 26 Nov 2015 00:34:47 +0000 (11:34 +1100)]
Change vmark functions to take a pane instead of a document.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange vmark_matching to take a pane rather than a doc.
NeilBrown [Thu, 26 Nov 2015 00:08:51 +0000 (11:08 +1100)]
Change vmark_matching to take a pane rather than a doc.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRender-attach functions no-longer need the pane_point.
NeilBrown [Wed, 25 Nov 2015 23:21:11 +0000 (10:21 +1100)]
Render-attach functions no-longer need the pane_point.

So discard it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc_{add,del,find}_view into commands.
NeilBrown [Wed, 25 Nov 2015 23:14:24 +0000 (10:14 +1100)]
Change doc_{add,del,find}_view into commands.

they get send to the document instead of having to find it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRegister keymaps early rather than late.
NeilBrown [Wed, 25 Nov 2015 23:11:04 +0000 (10:11 +1100)]
Register keymaps early rather than late.

The more we use them, the more careful we must be.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange mark_same to key off tile rather than point.
NeilBrown [Wed, 25 Nov 2015 22:48:48 +0000 (09:48 +1100)]
Change mark_same to key off tile rather than point.

Thus remove pointp reference from render-lines-notify

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoHave all "render-line" function fail cleanly if point/mark are NULL.
NeilBrown [Wed, 25 Nov 2015 22:36:49 +0000 (09:36 +1100)]
Have all "render-line" function fail cleanly if point/mark are NULL.

This makes it a bit cleaner to find the render-line pane with a void call.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoProvide a "Move-to" command to use e.g. when completing a search.
NeilBrown [Wed, 25 Nov 2015 22:27:37 +0000 (09:27 +1100)]
Provide a "Move-to" command to use e.g. when completing a search.

Better than direct access to point_to_mark().

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange default_render from a struct field to an attribute.
NeilBrown [Wed, 25 Nov 2015 22:15:51 +0000 (09:15 +1100)]
Change default_render from a struct field to an attribute.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse Move-File to move to start of a newly created document.
NeilBrown [Wed, 25 Nov 2015 22:10:16 +0000 (09:10 +1100)]
Use Move-File to move to start of a newly created document.

This is cleaner than moving the point directly

Signed-off-by: NeilBrown <neil@brown.name>
10 years agotext: fit bug with text deletion.
NeilBrown [Wed, 25 Nov 2015 21:47:07 +0000 (08:47 +1100)]
text: fit bug with text deletion.

I wasn't quite leaving things is a good state.
I think this is better - as this ref no longer over-takes
a follow ref that won't be relocated.
But I really need to review this code.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoemacs: use pane_final_child rather than pane_point.
NeilBrown [Wed, 25 Nov 2015 09:46:37 +0000 (20:46 +1100)]
emacs: use pane_final_child rather than pane_point.

This is (now) a suitable place to attach attributes.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoIntroduce doc:set-name
NeilBrown [Wed, 25 Nov 2015 09:38:37 +0000 (20:38 +1100)]
Introduce doc:set-name

Use this variously in mode-emacs to avoid pane_point calls.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp from render_format_attach
NeilBrown [Wed, 25 Nov 2015 09:23:47 +0000 (20:23 +1100)]
Remove pointp from render_format_attach

Not used.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse the new "ThisPane" to find pane to load new doc/file.
NeilBrown [Wed, 25 Nov 2015 09:15:13 +0000 (20:15 +1100)]
Use the new "ThisPane" to find pane to load new doc/file.

Makes the code nicer too.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoIntroduce ThisPane
NeilBrown [Wed, 25 Nov 2015 08:52:38 +0000 (19:52 +1100)]
Introduce ThisPane

This is similar to "OtherPane" but find the current tile.

popup uses this if it want to make a popup that is over a doc instead of
over the display.

This removes another use of ->point

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoIntroduce PointDup command
NeilBrown [Wed, 25 Nov 2015 07:58:05 +0000 (18:58 +1100)]
Introduce PointDup command

This make it possible to get a dup of point without
explicitly finding the point. Makes it more indirect.

You this in 'search' to avoid hunting up the tree.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoDon't make new point directly in doc_attach
NeilBrown [Wed, 25 Nov 2015 07:48:19 +0000 (18:48 +1100)]
Don't make new point directly in doc_attach

sometimes we want point_new sometimes point_dup

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoSplit a 'doc' pane aways from the 'view' panes.
NeilBrown [Wed, 25 Nov 2015 07:21:27 +0000 (18:21 +1100)]
Split a 'doc' pane aways from the 'view' panes.

They really are different things.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agouse new doc_attach_view for attaching "view"
NeilBrown [Wed, 25 Nov 2015 05:35:52 +0000 (16:35 +1100)]
use new doc_attach_view for attaching "view"

This is a common task and it is good to centralize it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoSplit doc_attach_view from doc_open.
NeilBrown [Wed, 25 Nov 2015 05:31:31 +0000 (16:31 +1100)]
Split doc_attach_view from doc_open.

It is silly combining these two functions with very different results.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agouse pane and mark to pass document to doc:set-attr
NeilBrown [Wed, 25 Nov 2015 04:59:09 +0000 (15:59 +1100)]
use pane and mark to pass document to doc:set-attr

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc:get-attr to use a pane rather than a point.
NeilBrown [Wed, 25 Nov 2015 04:55:39 +0000 (15:55 +1100)]
Change doc:get-attr to use a pane rather than a point.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse doc_notify_change rather than point_notify_change were possible.
NeilBrown [Wed, 25 Nov 2015 04:54:06 +0000 (15:54 +1100)]
Use doc_notify_change rather than point_notify_change were possible.

This gives more flexibility going forward.

Make sure doc_notify_change is just as fast when a point is provided.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse pane rather then point to pass doc to doc:step
NeilBrown [Wed, 25 Nov 2015 04:41:51 +0000 (15:41 +1100)]
Use pane rather then point to pass doc to doc:step

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse pane instead of point to pass doc to "Release"
NeilBrown [Wed, 25 Nov 2015 04:37:32 +0000 (15:37 +1100)]
Use pane instead of point to pass doc to "Release"

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc:set-ref to take a pane rather than a point.
NeilBrown [Wed, 25 Nov 2015 04:32:37 +0000 (15:32 +1100)]
Change doc:set-ref to take a pane rather than a point.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc_find to return a pane.
NeilBrown [Wed, 25 Nov 2015 03:38:15 +0000 (14:38 +1100)]
Change doc_find to return a pane.

That fits the pattern better.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove the document list and use a list of panes instead.
NeilBrown [Wed, 25 Nov 2015 03:19:10 +0000 (14:19 +1100)]
Remove the document list and use a list of panes instead.

The 'null display' (ed->root.focus) is now the parent of multiple
panes, each of which owns a document (->data) with a backlink
(doc->home->data == doc).

Now in many places we pass around this pane instead of a point when we
just want to identify a document and not a location in the document.
This means we don't need to allocate points so much, or fake up
temporary ones.

doc_attach() must be used at document creation to attach a document to
the tree.

So
 - "*Documents*" watches this list of siblings rather than the original list.
 - commands can be sent to these panes using key_handle_focus.  Some
   doc commands can be sent to any pane.
 - doc creation returns the pane of the document in ci->focus
   rather than a fake point
     e.g. same_file, load_file

 - pane_attach() takes a pane, not a point.
 - doc_open no-longer needs a gross hack
 - editor_choose_doc returns a pane, and so doesn't need a point.
 - popup holds the doc pane, not a point.

etc.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange 'editor' to be the root of the pane tree.
NeilBrown [Tue, 24 Nov 2015 22:36:50 +0000 (09:36 +1100)]
Change 'editor' to be the root of the pane tree.

Displays are all children of that root.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc:reundo and doc:get-str to use the pane-path.
NeilBrown [Tue, 24 Nov 2015 21:59:45 +0000 (08:59 +1100)]
Change doc:reundo and doc:get-str to use the pane-path.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agosend "doc:replace" up the pane path
NeilBrown [Tue, 24 Nov 2015 21:45:10 +0000 (08:45 +1100)]
send "doc:replace" up the pane path

Reduces need for passing points and documents around.
There will be more of this.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agotext: fix bug with refresh when text added to start of first line.
NeilBrown [Tue, 24 Nov 2015 21:23:25 +0000 (08:23 +1100)]
text: fix bug with refresh when text added to start of first line.

The return value didn't match the comment...

Signed-off-by: NeilBrown <neil@brown.name>
10 years agotext: fix undo/redo bug.
NeilBrown [Tue, 24 Nov 2015 21:12:29 +0000 (08:12 +1100)]
text: fix undo/redo bug.

we move the point ref forward, and them move along the mark list
to match.
But we need to go *beyond* any mark at the same position
else when we step the ref forward we won't know to keep going....
It is confusing, but this doesn't crash.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove the doc_operations structure complete.
NeilBrown [Tue, 24 Nov 2015 08:51:38 +0000 (19:51 +1100)]
Remove the doc_operations structure complete.

After all, it is empty now.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoMake 'step' a command.
NeilBrown [Tue, 24 Nov 2015 08:48:47 +0000 (19:48 +1100)]
Make 'step' a command.

This is the most-used command, I really have to optimise this one day.

Signed-off-by: NeilBrown <neil@brown.name>