bugGNU nano - Bugs: bug #61691, [Wish] make word-completion take...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #61691: [Wish] make word-completion take all open buffers into account

Submitted by:  Tasos Papastylianou <tpapastylianou>
Submitted on:  Fri 17 Dec 2021 02:29:52 PM UTC  
 
Severity:  1 - Wish Status:  None
Assigned to:  None Open/Closed:  Open

Mon 17 Jan 2022 03:30:19 PM UTC, comment #3: 

Still getting to grips with the source, but I can try :)

Tasos Papastylianou <tpapastylianou>
Wed 12 Jan 2022 03:08:32 PM UTC, comment #2: 

Yes, it would be nice if nano would look at all buffers for possible completions.  If you have a patch...

(No guarantee, though, that the patch would be applied.)

Benno Schulenberg <bens>
Project Administrator
Fri 17 Dec 2021 02:33:03 PM UTC, comment #1: 

PS. A nice side-effect of this is that one could open a separate buffer and fill it with an autocompletion dictionary, that could then be accessed for word-completions in other open buffers.

Tasos Papastylianou <tpapastylianou>
Fri 17 Dec 2021 02:29:52 PM UTC, original submission:  

When editing code, I often have the following situation where:
 - I am editing a primary file
 - The primary file needs to include/import a secondary file, and then use a variable or function defined in this secondary file
 - I would like to perform word-completion from within the PRIMARY file, to get the name of the variable/function defined in the SECONDARY file.

E.g. consider this python example

# in functions.py
def a_very_important_function():   print( "Hello, World!" )

# in main.py
import functions
functions.a_very_important_function()

If a_very_important_function +verbatim+ was defined directly in the primary file, then I could simply type 'a' and then perform word completion (default key-binding: Ctrl-] ).

However, because this only appears in the secondary file, and there's no other instance of this word in the primary file, word-completion will not work, and I'll have to type the entire thing by hand.

Obviously, subsequent autocompletions on the same word will work, because this now exists in the primary file as well. However, I think it would be more useful in general, if word-completion took into account all open buffers, rather than just the current one.

I have no opinion if this behaviour should simply replace the current behaviour, or if it should be toggleable in nature.

Tasos Papastylianou <tpapastylianou>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by tpapastylianou (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-12 bens Severity3 - Normal => 1 - Wish
        Summary[Wish] Make word-completion take into account all open buffers, not just current one => [Wish] make word-completion take all open buffers into account

    Back to the top


    Powered by Savane 3.7