[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] Cursor left/right movement with wrapping
From: |
Norbert Nemec |
Subject: |
Re: [Texmacs-dev] Cursor left/right movement with wrapping |
Date: |
Wed, 8 Dec 2004 21:45:21 +0100 |
User-agent: |
KMail/1.7.1 |
Hi Josef,
I don't have any detailed comment about what you are doing, but just a general
encouragement: The limited behavior of the cursor keys in TeXmacs definitely
is a hurdle not only for the newby but also for the experienced user.
A fullgrown clean solution as Joris is considering it certainly is a demanding
task which will take some time and has to compete with many other
high-priority issues.
Therefore, any hack that works in 99% of the cases would probably be welcome
by many users.
To Joris: In the long run, I think logical movement is absolutely crucial for
people to get a feeling for the inner workings of TeXmacs. If you use a
program, you need to understand its philosophy. I always liked WordPerfect,
because the keymovement really reflected the internal logics of the document.
In TeXmacs also, people will only start "thinking TeXmacs", if the movement
of the cursor reflects its internals. (Moving the cursor is very much like
"feeling" which connects to intuiting much more effectively than rational
understanding.) I know this is a deep issue that cannot be solved within a
few days. That's why I really would advise Josef and anyone else to think
about 99%-solutions for the moment.
Greetings,
Norbert
Am Mittwoch, 8. Dezember 2004 18:59 schrieb Josef Weidendorfer:
> Hi,
>
> I find it a little irritating that pressing key "right" at the and of a
> line doesn't go the the start of the next line. This is obviously because
> cursor movement is done only in geometrical means, i.e. cursor right always
> tries to go to the right. I think that at least if this is not possible, it
> should follow the text structure "to the right".
>
> Attached is a small patch to allow left/right cursor movement to wrap at
> line starts/ends in the middle of a paragraph. Currently I don't jump among
> different tree levels. Aren't there any general document tree navigation
> functions? I only found specialized version e.g. for searching.
>
> Similar, I think the following navigation should work:
> * Home/End to start/end of line instead of start/end of paragraph
> * C+Left/Right to previous/next word
> * C+Up/Down to previous/next paragraph
> Are patches welcome for this, or is this already possible with keyboard
> bindings?
>
> Cheers,
> Josef
>
> RCS file: /texmacs/src/src/Edit/Interface/edit_cursor.cpp,v
> retrieving revision 1.7
> diff -u -p -b -r1.7 edit_cursor.cpp
> --- edit_cursor.cpp 23 Sep 2004 11:17:23 -0000 1.7
> +++ edit_cursor.cpp 8 Dec 2004 17:50:59 -0000
> @@ -48,7 +48,20 @@ edit_cursor_rep::cursor_move_sub (SI& x0
> if (ref_p == tree_path (x0, y0, d0+ dx*DELTA)) {
> for (i=1; i<DELTA; i=i<<1)
> if (ref_p != tree_path (x0+ dx*i, y0+ dy*i, d0+ dx*DELTA)) break;
> - if (i>=DELTA) return false;
> + if (i>=DELTA) {
> + if (dx == 0) return false;
> +
> + // Try line wrapping for horizontal move
> + path p = path_add(ref_p,dx);
> + if (p == ref_p) return false;
> + cursor cu = eb->find_check_cursor(p);
> + if (!cu->valid) return false;
> + x0 = cu->ox;
> + y0 = cu->oy;
> + d0 = cu->delta;
> + tp = p;
> + return true;
> + }
> for (d=i>>2; d>=1; d=d>>1)
>
>
>
> _______________________________________________
> Texmacs-dev mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/texmacs-dev
--
_________________________________________Norbert Nemec
Bernhardstr. 2 ... D-93053 Regensburg
Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199
eMail: <address@hidden>