aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-05-26 17:13:57 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-05-26 17:13:57 -0400
commita0e14a2f9e18e324f94b6577f5bae2990b882a9d (patch)
treedf82dbab26050984d61522adf725021789c9a19b /modules
parent04b425baccdcfb5f62510ba2924d2dcd5add922a (diff)
downloadtextadept-a0e14a2f9e18e324f94b6577f5bae2990b882a9d.tar.gz
textadept-a0e14a2f9e18e324f94b6577f5bae2990b882a9d.zip
Fixed undocumented regression with word completion and case sensitivity.
This feature was inadvertently removed during a refactor.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/editing.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index c4339d63..d0331965 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -647,6 +647,7 @@ end
-- Returns for the word part behind the caret a list of whole word completions
-- constructed from the current buffer or all open buffers (depending on
-- `M.autocomplete_all_words`).
+-- If `buffer.auto_c_ignore_case` is `true`, completions are not case-sensitive.
-- @see buffer.word_chars
-- @see autocomplete
M.autocompleters.word = function()
@@ -656,7 +657,8 @@ M.autocompleters.word = function()
local word_part = buffer:text_range(s, buffer.current_pos)
for _, buffer in ipairs(_BUFFERS) do
if buffer == _G.buffer or M.autocomplete_all_words then
- buffer.search_flags = buffer.FIND_WORDSTART + buffer.FIND_MATCHCASE
+ buffer.search_flags = buffer.FIND_WORDSTART |
+ (not buffer.auto_c_ignore_case and buffer.FIND_MATCHCASE or 0)
buffer:target_whole_document()
while buffer:search_in_target(word_part) ~= -1 do
local e = buffer:word_end_position(buffer.target_end, true)