[go: up one dir, main page]

Menu

#2485 Conflict between SC_MULTIAUTOC_EACH and SCI_AUTOCSETDROPRESTOFWORD

Bug
open
nobody
5
2025-11-08
2025-07-13
Jiri Techet
No

There seems to be a problem when using SCI_AUTOCSETMULTI(SC_MULTIAUTOC_EACH) and SCI_AUTOCSETDROPRESTOFWORD(TRUE) leading to an unexpected autocompletion behavior with single caret. For more information, see https://github.com/geany/geany/issues/4373

Discussion

  • Neil Hodgson

    Neil Hodgson - 2025-07-16

    On vacation till mid September and can't investigate without a PC.

     
  • Zufu Liu

    Zufu Liu - 2025-07-16
    • labels: --> Scintilla, autocomplete
     
  • Neil Hodgson

    Neil Hodgson - 2025-09-28

    SC_MULTIAUTOC_EACH was a contribution from Mitchell Foral and was likely only designed for some circumstances. Fixing this does not appear simple to me so I'll likely not attempt to do so myself.

    There are multiple sub-problems here. "Drop rest of word" needs to know how long the word is at each selection but only determines the word end and thus word length at the primary selection. Could pass the option through to AutoCompleteInsert and calculate for each selection. Secondly, the first argument to AutoCompleteInsert isn't the selection position but offset from it by the start length (commonly number of characters in word before caret) so each selection should offset by this amount but there will be further problems if different words or positions within words are selected.

    There are 3 calls to AutoCompleteInsert - the common case inside AutoCompleteCompleted and 2 more for automatic choice when list only contains one choice. Any change should also work for 'choose single'.

    An ugly fix for just the reported problem is to coerce multiAutoCMode to Once when there is only one selection.

     
  • Jiri Techet

    Jiri Techet - 2025-11-08

    Thanks Neil, I think the easiest "fix" for Geany will be to stop using SC_MULTIAUTOC_EACH.

     

Log in to post a comment.