aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/.buffer.luadoc18
-rw-r--r--core/gui.lua2
2 files changed, 11 insertions, 9 deletions
diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc
index 6f57ac5b..8db47fd4 100644
--- a/core/.buffer.luadoc
+++ b/core/.buffer.luadoc
@@ -2837,14 +2837,6 @@ function save_as(buffer, utf8_filename) end
function close(buffer) end
---
--- Sets the name of the lexer used by the buffer to *lang*, loading its
--- language-specific module if the module exists.
--- @param buffer The global buffer.
--- @param lang The string language name to set.
--- @usage buffer.set_lexer(buffer, 'language_name')
-function set_lexer(buffer, lang) end
-
----
-- Returns the name of the lexer used by the buffer, or the name of the lexer
-- under the caret in a multiple-language lexer if *current* is `true`.
-- @param buffer The global buffer.
@@ -2854,6 +2846,16 @@ function set_lexer(buffer, lang) end
function get_lexer(buffer, current) end
---
+-- Sets the name of the lexer used by the buffer to *lang* or the auto-detected
+-- language and then loads the appropriate language-specific module if the
+-- module exists.
+-- @param buffer The global buffer.
+-- @param lang Optional string language name to set. If `nil`, attempts to
+-- auto-detect the buffer's language.
+-- @usage buffer.set_lexer(buffer, 'language_name')
+function set_lexer(buffer, lang) end
+
+---
-- Returns the name of style number *style_num*, in the range of `0` to `255`.
-- @param buffer The global buffer.
-- @param style_num The style number from `0` to `255` to get the name of.
diff --git a/core/gui.lua b/core/gui.lua
index 6cfa35c6..6869468f 100644
--- a/core/gui.lua
+++ b/core/gui.lua
@@ -357,7 +357,7 @@ events_connect(events.UPDATE_UI, function()
local pos = buffer.current_pos
local line, max = buffer:line_from_position(pos) + 1, buffer.line_count
local col = buffer.column[pos] + 1
- local lexer = buffer:private_lexer_call(GETLEXERLANGUAGE)
+ local lexer = buffer:private_lexer_call(GETLEXERLANGUAGE):match('^[^/]+')
local eol = EOLs[buffer.eol_mode + 1]
local tabs = string_format('%s %d', buffer.use_tabs and _L['Tabs:'] or
_L['Spaces:'], buffer.tab_width)