Ticket #1486 (closed defect: fixed)
Editor completion is confusing
Reported by: | dborca | Owned by: | slavazanko |
---|---|---|---|
Priority: | major | Milestone: | 4.7.0-pre3 |
Component: | mcedit | Version: | 4.7.0-pre1 |
Keywords: | Cc: | dborca@… | |
Blocked By: | Blocking: | ||
Branch state: | Votes for changeset: | committed-master |
Description
Editor completion became really confusing in 4.7.0-pre1:
- The list is populated with words from the entire file. This is arguably better than the old style, which scanned only up to the cursor. But the number of suggestions are limited, and if you have a bigger file, some words won't make it in the list. Besides, I somehow liked the old way.
- Suggestions do not end on a word boundary. This may or may be not useful; but it just increases the list of suggestions, which slows the user. In the end, it beats the purpose of completions.
- It completes the word I am currently editing. That's smart. :)
- The suggestions are displayed in the order in which they were found from the beginning of the file. This is my main gripe, because when using the editor for coding, it is better to have suggestions based on the distance to the cursor. Closer means higher. When writing a function, I am mainly interested in the variable names I recently used.
- Sometimes, it does not work at all, but I haven't investigated the bug. :(
I have attached the patch (against 4.7.0-pre1) which mimics the old behavior, but with the new search engine and minimal changes.
Attachments
Change History
comment:2 Changed 15 years ago by dborca
Regarding this in my original comment:
- Sometimes, it does not work at all, but I haven't investigated the bug. :(
static struct DLG_NODE *mc_manager = NULL;
will not complete "mc" to "mc_manager" because it expects (|
s) as left word boundary.
Changed 15 years ago by dborca
- Attachment mc-4.7.0-pre1.completion.2.patch added
Make sure we always get the closest match
comment:3 Changed 15 years ago by slavazanko
- Owner set to slavazanko
- Status changed from new to accepted
comment:4 Changed 15 years ago by slavazanko
- severity changed from no branch to on rework
- match_expr = g_strdup_printf ("(^|\\s)%.*s[^\\s\\.=\\+\\{\\}\\[\\]\\(\\)\\\\\\!\\,<>\\?\\/@#\\$%%\\^&\\*\\~\\|\\\"'\\:\\;]+", word_len, bufpos); + match_expr = g_strdup_printf ("\\b%.*s[a-zA-Z_0-9]+", word_len, bufpos);
Hm... I'm added wild regexp for international words autocompletion( such as Russain, Greek etc).
Do you have any idea how write correct regexp to do this?
I like to autocomplete all words, not just English-only.
Created branch 1486_editor_completion (parent: master)
State is 'on rework'.
See:
- changeset:49f5a65626cac70c24d7aadf254dc36a62d16870 - dborca's patch (as is)
- changeset:ab36296487f944a21bf4f85a59b6391f29ca7c6c - I like to fill autocomplete list from entire file (not just from BOF to cursor). Therefore, this behavior now optional. Default: from BOF to cursor
- changeset:6b6d8e4df498020a7c5d08e2c3fc8bd42df0ad51 - Need to complete this patch. Is someone have ideas how autocomplete national words?
comment:6 Changed 15 years ago by slavazanko
- severity changed from on rework to on review
Well. state 'on review'
initial commit:
8c6b664b4c44e52d3ff46b57c8c7d54e84342ad9
Full changes list:
git diff 8c6b664b4c44e52d3^..54bfb297b42ac53e9d
review, please.
comment:7 Changed 15 years ago by slavazanko
Fix codepage of autocompletion list:
changeset:7c834b95f15835853f8a65a726b6003a7e527784
Fix count of searched elements for autocompletion list. Also fixed codepage of inserted
into editor text:
changeset:1903ec8ce5e61f246ea97ea5197d50805c2f53ae
Added description of editor_wordcompletion_collect_entire_file option into man-file:
changeset:2cdb5450a1a0913ae5f3f6b8046558713e1053f1
review again, please.
comment:8 Changed 15 years ago by slavazanko
Added description of editor_wordcompletion_collect_entire_file option into mcedit.1 man-file:
changeset:db6a6f3f7308e54fd17bc3c958e8abd73fd75892
comment:10 Changed 15 years ago by angel_il
- Votes for changeset changed from andrew_b to andrew_b angel_il
- severity changed from on review to approved
comment:11 Changed 15 years ago by slavazanko
- Status changed from accepted to testing
- Votes for changeset changed from andrew_b angel_il to commited-master
- Resolution set to fixed
- severity changed from approved to merged