]>
git.neil.brown.name Git - edlib.git/log
NeilBrown [Wed, 9 Dec 2015 09:25:57 +0000 (20:25 +1100)]
Remove assignment to ci->mark in doc_file.
It isn't needed, and I want to make ci read-only.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 9 Dec 2015 09:00:02 +0000 (20:00 +1100)]
complete: remove the finding of the render-lines pane.
If we just make render-lines use "key_handle_focus", it is OK
for render-complete to be placed on top of the stack.
This makes things a lot cleaner.
We now need to let move-line through too.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 9 Dec 2015 08:38:58 +0000 (19:38 +1100)]
Change "render-line" to return line via a callback.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 06:54:26 +0000 (17:54 +1100)]
render-lines: don't set ci->hy unnecessarily.
I want 'ci' to be read-only inside commands.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 06:53:42 +0000 (17:53 +1100)]
Use REDEF_CMD to predeclate keymap_attach_func.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 06:32:28 +0000 (17:32 +1100)]
Use callbacks to return pane from render-*-attach commands.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 06:22:13 +0000 (17:22 +1100)]
use callbacks to return a pane from 'attach' commands.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 03:52:27 +0000 (14:52 +1100)]
Use callback to return string from doc:get-str
This way it is clear how ownership of the string is managed.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 03:36:16 +0000 (14:36 +1100)]
Use a callback to return string from doc:get-attr
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 02:01:47 +0000 (13:01 +1100)]
Use a callback to return mark for mark_at_point.
This might seem a bit forced, but I really think callbacks
like this are the best generic approach. I hope.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 01:54:17 +0000 (12:54 +1100)]
Unify calls to doc:dup-point.
All these calls can use mark_to_point - so do that.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 01:32:13 +0000 (12:32 +1100)]
Change Complete:prefix to return count directly.
with an offset of '1' to avoid returning '0'.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 01:28:14 +0000 (12:28 +1100)]
Change text-search to return result directly.
-2 is cannot find
-1 is incomplete regex
0 is no such commnd
N is match of length N-1 found.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 00:41:56 +0000 (11:41 +1100)]
Change doc:replace to return result directly.
There isn't must result here - just a flag to say "yes, a change was made".
But it was being handled completely wrongly!
I think it is fixed now.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 00:38:01 +0000 (11:38 +1100)]
Change doc:mark-same to return result directlry.
'1' means they are the same.
any other +ve number means they are different.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 00:33:08 +0000 (11:33 +1100)]
Change doc:step to return character directly.
Don't use ci for returing things.
As a char could be zero and WEOF could appear negative,
use high bits to make the number look positive.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 00:10:18 +0000 (11:10 +1100)]
Change doc:find-view to return value directly.
I'm moving away from using the cmd_info to return stuff.
So for numbers, just return them directly.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Dec 2015 00:01:18 +0000 (11:01 +1100)]
Update README file
Lots has happened since this was written...
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 4 Dec 2015 05:42:12 +0000 (16:42 +1100)]
python: make standard globals available to python scripts.
Also make 'editor' and 'edlib' available to subsequent function calls
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 4 Dec 2015 05:38:05 +0000 (16:38 +1100)]
Make symbols in loaded libraries global.
I don't really like doing this, but python needs it for
"import gtk" to work.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 4 Dec 2015 01:05:02 +0000 (12:05 +1100)]
Fix various issues with python
Now that I've started testing a bit more...
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 4 Dec 2015 01:03:50 +0000 (12:03 +1100)]
Remove 'buf' from pane_text
It isn't used.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 3 Dec 2015 23:47:26 +0000 (10:47 +1100)]
python: Add 'init' function for panes.
This calls pane_register.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 3 Dec 2015 22:52:16 +0000 (09:52 +1100)]
Python: add interface for pane_focus and pane_refresh.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 3 Dec 2015 22:48:35 +0000 (09:48 +1100)]
Create a command for defining new named commands.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 3 Dec 2015 22:47:50 +0000 (09:47 +1100)]
Initialise doc_default_cmd earlier.
It needs to be initialised before the very first doc is created.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 3 Dec 2015 22:38:28 +0000 (09:38 +1100)]
pane_refresh: always refresh whole display.
Anything else doesn't make sense.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 3 Dec 2015 22:21:29 +0000 (09:21 +1100)]
pane_refresh: allow post-order "Refresh" calls, by request.
This allows the display to flush out updates at the end,
without needing the '0-timeout' hack.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 3 Dec 2015 21:56:20 +0000 (08:56 +1100)]
Discard concept of persistent key modifiers.
I'm not using them and I no longer think they make sense.
The goal they were meant to serve is better served by
setting a new "global-set-keymap".
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 3 Dec 2015 21:51:06 +0000 (08:51 +1100)]
separate keyboard-input state into separate module.
This localises the concept and makes it possible to access
the state by sending commands.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 09:44:59 +0000 (20:44 +1100)]
Fix search bug: not finding longest match.
We need to keep going while we have a partial match (len=-1)
and record the last good match.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 09:28:39 +0000 (20:28 +1100)]
search: fix but with dot matching newlines.
Also default to case-insensitive until I get that configurable.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 09:21:11 +0000 (20:21 +1100)]
Search: note in prefix when search has wrapped.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 09:14:10 +0000 (20:14 +1100)]
use ->home->data, not ->focus->data
->focus isn't guaranteed to be the local pane. Home is.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 09:12:01 +0000 (20:12 +1100)]
Search: move to 'search start' when finishing the search.
This ensures the final search is from the current starting point.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 07:54:15 +0000 (18:54 +1100)]
Better handling of formatting with render-complete.
We highlight the common prefix and stripe all highlights
and quoting before using the string.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 07:35:54 +0000 (18:35 +1100)]
Fix bug causing render-complete to show a non-matching first line.
That "Move-to" needs to get through.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 03:51:16 +0000 (14:51 +1100)]
search: make sure point is visible when search is aborted.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 03:40:23 +0000 (14:40 +1100)]
render-format: allow '<' characters in format fields.
These need to be quoted.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 03:22:33 +0000 (14:22 +1100)]
Use the © copyright character is copyright messages.
Because I can...
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 03:19:07 +0000 (14:19 +1100)]
Add lib-messageline.
This places a line on the bottom on the display and displayed messages there.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 02:26:07 +0000 (13:26 +1100)]
ncurses: allow use of full screen.
If we want to trim a line off the bottom, do it separately.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 02:23:58 +0000 (13:23 +1100)]
Save search string for later re-use.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 02:11:24 +0000 (13:11 +1100)]
Disable recursive popups except by permission.
So trying to search in a file-file buffer now doesn't work.
This might need work for searching in a completion list??
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 01:56:07 +0000 (12:56 +1100)]
tile: fix 'next' to walk through all pop-ups.
Still need to work on 'prev'!
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 01:05:06 +0000 (12:05 +1100)]
Move root popups to the tile-root.
Having popups always attached to tiles seems clean and will make
pane-movement easier.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Dec 2015 00:02:14 +0000 (11:02 +1100)]
Page up/down now move cursor to EOF when appropriate.
emacs doesn't do this, but I think it looks better... maybe.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 1 Dec 2015 22:46:28 +0000 (09:46 +1100)]
Fix page-up/down in directory listings.
If the target for cursorXY is in the header line, we need to adjust.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 1 Dec 2015 22:11:32 +0000 (09:11 +1100)]
Introduce some 'call*' functions to call command.
This simplifies lots of code.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 1 Dec 2015 20:53:00 +0000 (07:53 +1100)]
Quote regex chars when they are included from doc into search string.
Also handle unicode search properly.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 1 Dec 2015 20:43:18 +0000 (07:43 +1100)]
text: fix bug with adding at end of allocation.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 1 Dec 2015 20:35:02 +0000 (07:35 +1100)]
Rename comm_ncurses to display_ncurses
"comm_" is part of an old deprecated naming scheme.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 1 Dec 2015 20:19:43 +0000 (07:19 +1100)]
NeilBrown [Sun, 29 Nov 2015 21:50:58 +0000 (08:50 +1100)]
Move the authoritative 'point' out of the pane and into the doc_data.
This seems a more sensible location.
The point still exists in the pane as it is very useful, but this is
now just a 'borrowed' pointer.
This required changing doc_attr to only examine a single pane.
Probably makes sense for now.
Next patch will make changes to how points in panes are managed.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 29 Nov 2015 21:50:01 +0000 (08:50 +1100)]
Fix up entry of multi-byte UTF-8
I wasn't handling wide characters on text-entry, and
text_round_len was wrong.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 29 Nov 2015 21:49:16 +0000 (08:49 +1100)]
Initial python support.
Add a new loadable module 'lang-python' which provides a
"python-load" command which will run a python script.
This has access to panes and marks and can send and receive commands...
At least it can in principle - only limited testing so far.
I think it is a good starting point for python support.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 27 Nov 2015 05:06:08 +0000 (16:06 +1100)]
Add another check for a NULL string.
This allows render_line_prev to make more sense at end-of-doc.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 27 Nov 2015 05:04:16 +0000 (16:04 +1100)]
Allow both start- and end- of file movements in render-complete.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 27 Nov 2015 05:03:22 +0000 (16:03 +1100)]
EOF in *Documents* is a null pointer, not the last entry.
Signed-off-by: NeilBrown <neil@brown.name>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
NeilBrown [Thu, 26 Nov 2015 23:31:44 +0000 (10:31 +1100)]
Remove unused function point_reset
Signed-off-by: NeilBrown <neil@brown.name>
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>
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>
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>
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>
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>
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>
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>
NeilBrown [Thu, 26 Nov 2015 07:00:06 +0000 (18:00 +1100)]
emacs_kill_doc - no pointp
Signed-off-by: NeilBrown <neil@brown.name>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>