Skip to main content

core.docview

local docview = require "core.docview"

__index

(field) __index: core.object

cache_font

(field) cache_font: unknown

cache_font_size

(field) cache_font_size: unknown

cache_indent_size

(field) cache_indent_size: unknown

context

(field) context: string

current_scale

(field) current_scale: number

cursor

(field) cursor: string

doc

(field) doc: any

font

(field) font: string

h_scrollbar

(field) h_scrollbar: core.scrollbar

Scrollbar Use Scrollbar:set_size to set the bounding box of the view the scrollbar belongs to. Use Scrollbar:update to update the scrollbar animations. Use Scrollbar:draw to draw the scrollbar. Use Scrollbar:on_mouse_pressed, Scrollbar:on_mouse_released, Scrollbar:on_mouse_moved and Scrollbar:on_mouse_left to react to mouse movements; the scrollbar won't update automatically. Use Scrollbar:set_percent to set the scrollbar location externally.

To manage all the orientations, the scrollbar changes the coordinates system accordingly. The "normal" coordinate system adapts the scrollbar coordinates as if it's always a vertical scrollbar, positioned at the end of the bounding box.


hovered_scrollbar

(field) hovered_scrollbar: boolean

hovering_gutter

(field) hovering_gutter: boolean

ime_selection

(field) ime_selection: table

ime_status

(field) ime_status: boolean

last_col1

(field) last_col1: unknown

last_col2

(field) last_col2: unknown

last_line1

(field) last_line1: unknown

last_line2

(field) last_line2: unknown

last_x_offset

(field) last_x_offset: table

mouse_selecting

(field) mouse_selecting: unknown

position

(field) position: core.view.position

scroll

(field) scroll: core.view.scroll

scrollable

(field) scrollable: boolean

size

(field) size: core.view.position

super

(field) super: core.view

Base view.


translate

(field) translate: table

v_scrollbar

(field) v_scrollbar: core.scrollbar

Scrollbar Use Scrollbar:set_size to set the bounding box of the view the scrollbar belongs to. Use Scrollbar:update to update the scrollbar animations. Use Scrollbar:draw to draw the scrollbar. Use Scrollbar:on_mouse_pressed, Scrollbar:on_mouse_released, Scrollbar:on_mouse_moved and Scrollbar:on_mouse_left to react to mouse movements; the scrollbar won't update automatically. Use Scrollbar:set_percent to set the scrollbar location externally.

To manage all the orientations, the scrollbar changes the coordinates system accordingly. The "normal" coordinate system adapts the scrollbar coordinates as if it's always a vertical scrollbar, positioned at the end of the bounding box.


__call

(method) core.object:__call(...any)
-> core.object

Metamethod to allow using the object call as a constructor.


__tostring

(method) core.object:__tostring()
-> string

Metamethod to get a string representation of an object.


clamp_scroll_position

(method) core.view:clamp_scroll_position()

draw

(method) core.docview:draw()

draw_background

(method) core.view:draw_background(color: renderer.color)

draw_caret

(method) core.docview:draw_caret(x: any, y: any, line: any, col: any)

draw_ime_decoration

(method) core.docview:draw_ime_decoration(line1: any, col1: any, line2: any, col2: any)

draw_line_body

(method) core.docview:draw_line_body(line: any, x: any, y: any)
-> integer

draw_line_gutter

(method) core.docview:draw_line_gutter(line: any, x: any, y: any, width: any)
-> integer

draw_line_highlight

(method) core.docview:draw_line_highlight(x: any, y: any)

draw_line_text

(method) core.docview:draw_line_text(line: any, x: any, y: any)
-> integer

draw_overlay

(method) core.docview:draw_overlay()

draw_scrollbar

(method) core.view:draw_scrollbar()

extend

(method) core.object:extend()
-> core.object

extends

(method) core.object:extends(T: any)
-> boolean

Check if the object inherits from the given type.


get_col_x_offset

(method) core.docview:get_col_x_offset(line: any, col: any)
-> integer|unknown

get_content_bounds

(method) core.view:get_content_bounds()
-> number
2. number
3. number
4. number

get_content_offset

(method) core.view:get_content_offset()
-> x: number
2. y: number

get_filename

(method) core.docview:get_filename()
-> string|unknown

get_font

(method) core.docview:get_font()
-> unknown

get_gutter_width

(method) core.docview:get_gutter_width()
-> unknown
2. number

get_h_scrollable_size

(method) core.docview:get_h_scrollable_size()
-> number

get_line_height

(method) core.docview:get_line_height()
-> integer

get_line_screen_position

(method) core.docview:get_line_screen_position(line: any, col: any)
-> unknown
2. unknown

get_line_text_y_offset

(method) core.docview:get_line_text_y_offset()
-> unknown

get_name

(method) core.docview:get_name()
-> unknown

get_scrollable_size

(method) core.docview:get_scrollable_size()
-> number

get_visible_line_range

(method) core.docview:get_visible_line_range()
-> integer
2. integer

get_x_offset_col

(method) core.docview:get_x_offset_col(line: any, x: any)
-> integer

is

(method) core.object:is(T: any)
-> boolean

Check if the object is strictly of the given type.


is_class_of

(method) core.object:is_class_of(T: any)
-> boolean

Check if the parameter is strictly of the object type.


is_extended_by

(method) core.object:is_extended_by(T: any)
-> boolean

Check if the parameter inherits from the object.


mouse_selection

(method) core.docview:mouse_selection(doc: any, snap_type: any, line1: any, col1: any, line2: any, col2: any)
-> unknown
2. integer|unknown
3. unknown
4. integer|unknown

move_towards

(method) core.view:move_towards(t: any, k: any, dest: any, rate: any, name: any)

new

(method) core.docview:new(doc: any)

on_file_dropped

(method) core.view:on_file_dropped(filename: string, x: number, y: number)
-> boolean

on_ime_text_editing

(method) core.docview:on_ime_text_editing(text: any, start: any, length: any)

on_mouse_left

(method) core.view:on_mouse_left()

on_mouse_moved

(method) core.docview:on_mouse_moved(x: number, y: number, ...any)

on_mouse_pressed

(method) core.docview:on_mouse_pressed(button: 'left'|'right', x: number, y: number, clicks: integer)
-> boolean|nil

on_mouse_released

(method) core.docview:on_mouse_released(...any)

on_mouse_wheel

(method) core.view:on_mouse_wheel(y: number, x: number)
-> boolean

@param y — Vertical scroll delta; positive is "up"

@param x — Horizontal scroll delta; positive is "left"

@return — Capture event


on_scale_change

(method) core.view:on_scale_change(new_scale: number, prev_scale: number)

Can be overriden to listen for scale change events to apply any neccesary changes in sizes, padding, etc...


on_text_input

(method) core.docview:on_text_input(text: string)

on_touch_moved

(method) core.view:on_touch_moved(x: number, y: number, dx: number, dy: number, i: number)

resolve_screen_position

(method) core.docview:resolve_screen_position(x: any, y: any)
-> number
2. integer

scroll_to_line

(method) core.docview:scroll_to_line(line: any, ignore_if_visible: any, instant: any)

scroll_to_make_visible

(method) core.docview:scroll_to_make_visible(line: any, col: any)

scrollbar_dragging

(method) core.view:scrollbar_dragging()
-> boolean

scrollbar_hovering

(method) core.view:scrollbar_hovering()
-> boolean

scrollbar_overlaps_point

(method) core.view:scrollbar_overlaps_point(x: number, y: number)
-> boolean

supports_text_input

(method) core.docview:supports_text_input()
-> boolean

try_close

(method) core.docview:try_close(do_close: any)

update

(method) core.docview:update()

update_ime_location

(method) core.docview:update_ime_location()

Update the composition bounding box that the system IME will consider when drawing its interface


update_scrollbar

(method) core.view:update_scrollbar()