Commit graph

253 commits

Author SHA1 Message Date
Florent Le Coz
e02f93a8ef Increase the number of chars to "jump" when the cursor goes out of the input 2013-10-21 00:41:50 +02:00
Florent Le Coz
b12a6b3ba9 Improve the input a lot
Noticeable changes:

- The input "view" is smarter, it always move to a decent position so we can
  see enough text around the cursor.
- The cursor goes at the end of the input when pasting some long text
- The formatting chars (^C and o, b, a, 1, 2, 3 etc) are now visible in the
  input. This makes it a lot easier to know where these special characters
  are, to change them and efficiently edit our text (we just lose a little,
  on the cosmetic side, but who cares)
- The code is actually a lot simpler in the functions to move the cursor,
  insert/delete chars: we do not have to deal with special cases where the
  formatting characters are actually composed of two chars.

fixes #2183
2013-10-20 23:42:13 +02:00
Mathieu Pasquet
40af34ad7c Fix #2372 (traceback on space in roster after disconnect)
selected_row wasn’t reset
2013-09-19 00:19:42 +02:00
mathieui
cb8884bae4 quote a completed word if it has \ in it 2013-08-16 17:49:05 +02:00
mathieui
416ceddbe4 Add the same pluggable "information element" to the PrivateTab 2013-08-04 15:28:35 +02:00
mathieui
6fbb2f8593 Fix #2317 (/join completion is broken)
Also add an override parameter to new_completion so that the
completion does not care if the list matches the previous input
or not.
2013-08-02 22:00:53 +02:00
mathieui
bb59771d99 Fix #2049 (get the current completed argument)
A command argument can now be completed even if it isn’t the last
one in the input.

- Add a new method Input.new_completion
    Almost like the old auto_completion method, except taht it takes
    another argument: argument_position, which is the argument to be
    completed.
- Methods using the old completion method still work
- All completion methods in poezio now use the new one if necessary
- Further details can be found in the docstring of new_completion
2013-08-01 20:17:12 +02:00
mathieui
19135d4a76 Fix #2306 (none, to, and from subscriptions should be more visible)
Added a configuration option and some theme variables.
2013-07-31 23:43:19 +02:00
mathieui
cae5f64931 Move backwards in the input the same way we move forward (ref #2183) 2013-07-03 00:21:13 +02:00
mathieui
f8aa0f9826 Fix #2329 (display the info buffer in the muclisttab)
also fix some typos in the comments, and a refresh issue with the input
2013-06-30 19:36:32 +02:00
Florent Le Coz
d81568eebe Use a logical order of arguments in the poopt functions, now 2013-06-20 23:28:40 +02:00
Florent Le Coz
5b4048000e Use cut_by_columns to properly cut nicks in the UserWin window 2013-06-20 22:30:08 +02:00
Florent Le Coz
637b5552e8 Remove the now useless (and fucking slow) wcwidth python implementation 2013-06-19 22:27:15 +02:00
Florent Le Coz
0d7fedceea And actually use poopt.wcswidth to properly count the nicks' size
see #2142
2013-06-19 22:19:17 +02:00
Florent Le Coz
0bcd420602 Consider the number of columns of each characters in the poopt module
Some characters take 0 columns, others take 1 or 2 (full-width characters)

fixes #2142
2013-06-19 22:18:50 +02:00
mathieui
833faa4f37 Improve the roster search
- now case-insensitive
- search in the bare jid instead of userpart only (and still in roster
  names)
- do not display groups when searching
- display offline contacts
- do not expand resources if they were before the search
2013-06-13 01:00:53 +02:00
mathieui
4220c36021 Fix addstr_colored with colors that start with a -1 2013-06-10 20:53:16 +02:00
mathieui
2668df740b Fix #1892 (keep the contact selected in the roster) 2013-06-09 15:36:50 +02:00
mathieui
103d097acf Fix #2183 (do not scroll one char at a time when you reach the end)
Now it scrolls horizontally of 1/4 the size of the input
2013-06-09 15:18:39 +02:00
mathieui
26ea842cee Add a way to format background colors in a string
(also add colors to the /info command in MUCs)
2013-06-08 17:36:02 +02:00
Florent Le Coz
463ec5ca0d Accept NULL bytes in strings to be cut by the poopt module
fix #2296
2013-06-07 00:04:01 +02:00
mathieui
ee8de89f9e Fix #2307 (commandinput history) 2013-05-16 16:08:30 +02:00
mathieui
7f1562c4c2 Actually use it. 2013-05-11 21:43:45 +02:00
mathieui
a1ef835a37 Handle the roster order cache as a real cache
When an external (or internal) event may cause the order of the
cache to be modified, or new elements to be added, schedule it
for a rebuild. Otherwise, don’t, and only rebuild it when
refreshing (that should improve refresh speed a lot).

Also, if the position in the roster is further than the total size
of the roster, go back to the top instead of displaying an empty
window with “+++”.
2013-05-11 20:51:11 +02:00
mathieui
ca8b67fca9 Fix #2131 (Input cursor when pasting text) 2013-05-10 00:49:38 +02:00
Florent Le Coz
beb374f7e3 Make Alt+backspace work on my freebsd 2013-05-01 19:03:32 +02:00
mathieui
26fa83dd9a Add an option to choose between shared and separate input history
- separate_history, defaults to false
2013-04-04 01:11:56 +02:00
mathieui
8a5a5bb644 Fix #2255 (search in input history)
- The input is split in two parts: on the left is what the user enters,
    on the right is the first match (the right part has a different
    color)
- Start and cancel a search with ^R
- Validate a search with enter, then press another time enter to send

- CommandInput and MessageInput now inherit from the HistoryInput class
  and share some methods
2013-04-04 01:03:18 +02:00
mathieui
57ce4b6fdf Fix #2265
also:
- fix Message.__str__/repr
- fix a traceback with user gaming
2013-03-13 22:49:19 +01:00
mathieui
d797b1fd65 Implement user gaming (xep-0196)
- configuration options
- theming options
- /gaming
2013-03-12 16:12:47 +01:00
mathieui
cec1151ecb Fix #1839 (User mood/activity)
- Added as always new theming variables:
    CHAR_ROSTER_MOOD, CHAR_ROSTER_ACTIVITY (a SNOWMAN!)
    COLOR_ROSTER_MOOD, COLOR_ROSTER_ACTIVITY
- Added two new notification types in Theme.INFO_COLORS (mood/activity)
- Added new configuration options:
    display_mood/activity/tune_notifications (those can be set for a
    specific JID)
    enable_user_tune/nick/activity/mood
- Added /activity and /mood commands, with completions
- Moved the old /activity to /last_activity
- Details are show in the ContactInfoWin if there is room, or with "i"
  on a contact in the roster.
2013-03-11 23:06:52 +01:00
mathieui
71c35eb279 Implement XEP-0118 (Fix #1840)
- Add new theming options
- Show the tune in the roster (both in contact line and infowin)
- add an option to show tunes as info messages
2013-03-11 02:04:20 +01:00
mathieui
d87834760f Fix #2122 (coloration of long messages)
- Add a “prepend” attribute to the Line tuple

I’m not sure of the impact of this on performance (we parse the message
yet another time)
2013-03-10 18:35:51 +01:00
mathieui
3f71405efd Add a CHAR_NEW_TEXT_SEPARATOR theming option 2013-03-06 22:34:41 +01:00
mathieui
f40cfe2669 Add a show_s2s_errors config option (cf #2182) 2013-03-04 16:01:35 +01:00
mathieui
3d98f48ba2 Fix #2182 (show s2s errors)
- Add the theming options COLOR_ROSTER_ERROR, CHAR_ROSTER_ERRROR, and
    CHAR_ROSTER_ASKED
2013-03-03 13:13:15 +01:00
mathieui
f4c275eb07 Add an indicator of the number of participants
(like in weechat)
2013-02-13 21:29:14 +01:00
mathieui
27d85a0961 Fix the folding of contacts in multiple groups
(add a defaultdict to keep the folded state in each group)
2013-02-03 23:55:13 +01:00
Florent Le Coz
a76b016f95 Add a key (Alt+d) de delete the next word in the input. 2013-02-03 22:17:22 +01:00
Florent Le Coz
dd9f6936be Remove some useless keys, and change the keys to scroll the info win.
M-d and M-c become M-D and M-C
2013-02-03 22:15:10 +01:00
Florent Le Coz
e0136e785a scroll_to_separator now scrolls to the top if there’s no separator. 2013-01-29 07:58:20 +01:00
Florent Le Coz
13b5ab4b65 Makes next_hl and prev_hl work after a scroll_to_separator.
This makes it easy to review all the highlights after the separator was
placed, using M-h, M-n, M-n, M-n…

We just add a counter of highlights which is incremented each time there’s
an hl, and set to zero when we reset the separator. We use that counter to
set hl_pos when we scroll to the separator.
2013-01-29 07:58:20 +01:00
Florent Le Coz
dd2a6d1d65 Implement XEP 296 for locking resource in conversations.
With a few specific behaviours: When manually opening a conversation with a
bare jid, we open a normal conversation that follows the XEP (locked and
unlocked accordingly). If the user manually opens a conversation with a
fulljid (by selecting a specific resource in the roster, or by specifying a
fulljid to the /message command), we open a special tab that doesn’t follow
the XEP (it is always locked to the same resource, and cannot be unlocked).

When a message is received, unless a special tab has been manually opened by
the other with that specific resource, we always send the messages to a uniq
normal tab, unlocking or locking it according to the XEP.

This means that only one tab can be opened with a given contact, unless the
user specifically chooses to open a special tab for a specific resource.

fixes #2159
2013-01-26 05:35:07 +01:00
mathieui
61f469bc12 Don’t rebuild the lines on resize when the width has not changed
- because it is an heavy operation, and it is useless, since the lines
  only change when the width changes.
2013-01-23 09:29:28 +01:00
mathieui
1bf61cde38 Break the ugly roster refresh loop into two
- The code is more understandable
- The number of iterations may have slightly increased
- Less things are done inside the lock, so the overall experience should
  be smoother
2013-01-21 19:23:23 +01:00
mathieui
b06240ee7b Improve the xml tab
fix refresh bugs, display the scrolling status, add an info bar, add the
global info win
2013-01-11 19:54:30 +01:00
mathieui
17d0527cf8 Fix a traceback with corrections 2013-01-02 01:36:53 +01:00
mathieui
d66cf8e1fe Typo 2012-12-30 19:31:27 +01:00
mathieui
80c79d8b79 Fix #2189 Fix #2139 - Make /correct work properly in all chat tabs
#2189 wasn’t crashing, but well.
Also fix a crash with the separator and /correct
2012-12-30 19:27:59 +01:00
mathieui
0f9b37b8a8 Do not rebuild everything in order to modify a message
(should fix the “leak” on /correct, and make it faster)
2012-12-30 14:54:54 +01:00