Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–48 unchanged (48 lines)
49end
50
51--- Add an initialization callback.
52-- This callback will be executed before the mouse grabbing starts.
53-- @function awful.mouse.resize.add_enter_callback
54-- @tparam function cb The callback (or nil)
55-- @tparam[default=other] string context The callback context
56function module.add_enter_callback(cb, context)
57 context = context or "other"
58 callbacks.enter[context] = callbacks.enter[context] or {}
59 table.insert(callbacks.enter[context], cb)
60end
61
62--- Add a "move" callback.
63-- This callback is executed in "after" mode (see `set_mode`) instead of
64-- applying the operation.
65-- @function awful.mouse.resize.add_move_callback
66-- @tparam function cb The callback (or nil)
67-- @tparam[default=other] string context The callback context
68function module.add_move_callback(cb, context)
69 context = context or "other"
70 callbacks.move[context] = callbacks.move[context] or {}
71 table.insert(callbacks.move[context], cb)
72end
73
74--- Add a "leave" callback
75-- This callback is executed just before the `mousegrabber` stop
76-- @function awful.mouse.resize.add_leave_callback
77-- @tparam function cb The callback (or nil)
78-- @tparam[default=other] string context The callback context
79function module.add_leave_callback(cb, context)
80 context = context or "other"
81 callbacks.leave[context] = callbacks.leave[context] or {}
82 table.insert(callbacks.leave[context], cb)
83end
84
…lines 85–89 unchanged (5 lines)
90-- * *move_callback*: A function called when the mouse moves.
91-- * *leave_callback*: A function called before the `mousegrabber` is released.
92-- * *mode*: The resize mode.
93--
94-- @function awful.mouse.resize
95-- @tparam client client A client.
96-- @tparam[default=mouse.resize] string context The resizing context.
97-- @tparam[opt={}] table args A set of `awful.placement` arguments.
98-- @request wibox geometry mouse.resize granted Requests to resize the wibox.
99local function handler(_, client, context, args) --luacheck: no unused_args
100 args = args or {}
101 context = context or "mouse.resize"
102
103 local placement = args.placement
104
105 if type(placement) == "string" and aplace[placement] then
…lines 106–250 unchanged (145 lines)

After

…lines 1–48 unchanged (48 lines)
49end
50
51--- Add an initialization callback.
52-- This callback will be executed before the mouse grabbing starts.
53-- @function awful.mouse.resize.add_enter_callback
54-- @tparam function cb The callback (or nil)
55-- @tparam[opt="other"] string context The callback context
56function module.add_enter_callback(cb, context)
57 context = context or "other"
58 callbacks.enter[context] = callbacks.enter[context] or {}
59 table.insert(callbacks.enter[context], cb)
60end
61
62--- Add a "move" callback.
63-- This callback is executed in "after" mode (see `set_mode`) instead of
64-- applying the operation.
65-- @function awful.mouse.resize.add_move_callback
66-- @tparam function cb The callback (or nil)
67-- @tparam[opt="other"] string context The callback context
68function module.add_move_callback(cb, context)
69 context = context or "other"
70 callbacks.move[context] = callbacks.move[context] or {}
71 table.insert(callbacks.move[context], cb)
72end
73
74--- Add a "leave" callback
75-- This callback is executed just before the `mousegrabber` stop
76-- @function awful.mouse.resize.add_leave_callback
77-- @tparam function cb The callback (or nil)
78-- @tparam[opt="other"] string context The callback context
79function module.add_leave_callback(cb, context)
80 context = context or "other"
81 callbacks.leave[context] = callbacks.leave[context] or {}
82 table.insert(callbacks.leave[context], cb)
83end
84
…lines 85–89 unchanged (5 lines)
90-- * *move_callback*: A function called when the mouse moves.
91-- * *leave_callback*: A function called before the `mousegrabber` is released.
92-- * *mode*: The resize mode.
93--
94-- @function awful.mouse.resize
95-- @tparam client client A client.
96-- @tparam[opt=mouse.resize] string context The resizing context.
97-- @tparam[opt={}] table args A set of `awful.placement` arguments.
98-- @request wibox geometry mouse.resize granted Requests to resize the wibox.
99-- @usebeautiful beautiful.cursor_mouse_move
100-- @usebeautiful beautiful.cursor_mouse_resize
101local function handler(_, client, context, args) --luacheck: no unused_args
102 args = args or {}
103 context = context or "mouse.resize"
104
105 local placement = args.placement
106
…lines 107–252 unchanged (146 lines)

Before

chunk
comment
-- "--"
comment_content "------------------------------------------------------------"...
comment
-- "--"
comment_content "- An extensible mouse resizing handler."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " This module offers a resizing and moving mechanism for draw"...
comment
-- "--"
comment_content " clients and wiboxes."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " @author Emmanuel Lepage Vallee <elv1313@gmail.com>"
comment
-- "--"
comment_content " @copyright 2016 Emmanuel Lepage Vallee"
comment
-- "--"
comment_content " @submodule mouse"
comment
-- "--"
comment_content "------------------------------------------------------------"...
variable_declaration
local "local"
assignment_statement
variable_list
identifier "aplace"
= "="
expression_list
function_call
identifier "require"
arguments
( "("
string
" "\""
string_content "awful.placement"
" "\""
) ")"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "capi"
= "="
expression_list
table_constructor
{ "{"
field
identifier "mousegrabber"
= "="
identifier "mousegrabber"
, ","
field
identifier "client"
= "="
identifier "client"
} "}"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "beautiful"
= "="
expression_list
function_call
identifier "require"
arguments
( "("
string
" "\""
string_content "beautiful"
" "\""
) ")"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "floating"
= "="
expression_list
function_call
identifier "require"
arguments
( "("
string
" "\""
string_content "awful.layout.suit.floating"
" "\""
) ")"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "module"
= "="
expression_list
table_constructor
{ "{"
} "}"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "mode"
= "="
expression_list
string
" "\""
string_content "live"
" "\""
variable_declaration
local "local"
assignment_statement
variable_list
identifier "req"
= "="
expression_list
string
" "\""
string_content "request::geometry"
" "\""
variable_declaration (+30 nodes collapsed)
variable_declaration (+140 nodes collapsed)
comment
-- "--"
comment_content "- Set the resize mode."
comment
-- "--"
comment_content " The available modes are:"
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " * **live**: Resize the layout everytime the mouse moves."
comment
-- "--"
comment_content " * **after**: Resize the layout only when the mouse is relea"...
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " Some clients, such as XTerm, may lose information if resize"...
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " @function awful.mouse.resize.set_mode"
comment
-- "--"
comment_content " @tparam string m The mode"
function_declaration (+39 nodes collapsed)
comment
-- "--"
comment_content "- Add an initialization callback."
comment
-- "--"
comment_content " This callback will be executed before the mouse grabbing st"...
comment
-- "--"
comment_content " @function awful.mouse.resize.add_enter_callback"
comment
-- "--"
comment_content " @tparam function cb The callback (or nil)"
comment
-- "--"
comment_content " @tparam[default=other] string context The callback context"
function_declaration (+69 nodes collapsed)
comment
-- "--"
comment_content "- Add a \"move\" callback."
comment
-- "--"
comment_content " This callback is executed in \"after\" mode (see `set_mode`) "...
comment
-- "--"
comment_content " applying the operation."
comment
-- "--"
comment_content " @function awful.mouse.resize.add_move_callback"
comment
-- "--"
comment_content " @tparam function cb The callback (or nil)"
comment
-- "--"
comment_content " @tparam[default=other] string context The callback context"
function_declaration (+69 nodes collapsed)
comment
-- "--"
comment_content "- Add a \"leave\" callback"
comment
-- "--"
comment_content " This callback is executed just before the `mousegrabber` st"...
comment
-- "--"
comment_content " @function awful.mouse.resize.add_leave_callback"
comment
-- "--"
comment_content " @tparam function cb The callback (or nil)"
comment
-- "--"
comment_content " @tparam[default=other] string context The callback context"
function_declaration (+69 nodes collapsed)
comment
-- "--"
comment_content "- Resize the drawable."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " Valid `args` are:"
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " * *enter_callback*: A function called before the `mousegrab"...
comment
-- "--"
comment_content " * *move_callback*: A function called when the mouse moves."
comment
-- "--"
comment_content " * *leave_callback*: A function called before the `mousegrab"...
comment
-- "--"
comment_content " * *mode*: The resize mode."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " @function awful.mouse.resize"
comment
-- "--"
comment_content " @tparam client client A client."
comment
-- "--"
comment_content " @tparam[default=mouse.resize] string context The resizing c"...
comment
-- "--"
comment_content " @tparam[opt={}] table args A set of `awful.placement` argum"...
comment
-- "--"
comment_content " @request wibox geometry mouse.resize granted Requests to re"...
function_declaration (+821 nodes collapsed)
function_declaration (+162 nodes collapsed)
function_call
dot_index_expression
dot_index_expression
identifier "capi"
. "."
identifier "client"
. "."
identifier "connect_signal"
arguments
( "("
string
" "\""
string_content "request::geometry"
" "\""
, ","
dot_index_expression
identifier "module"
. "."
identifier "_resize_handler"
) ")"
return_statement
return "return"
expression_list
function_call
identifier "setmetatable"
arguments
( "("
identifier "module"
, ","
table_constructor
{ "{"
field
identifier "__call"
= "="
identifier "handler"
} "}"
) ")"
comment
-- "--"
comment_content " vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabs"...

After

chunk
comment
-- "--"
comment_content "------------------------------------------------------------"...
comment
-- "--"
comment_content "- An extensible mouse resizing handler."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " This module offers a resizing and moving mechanism for draw"...
comment
-- "--"
comment_content " clients and wiboxes."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " @author Emmanuel Lepage Vallee <elv1313@gmail.com>"
comment
-- "--"
comment_content " @copyright 2016 Emmanuel Lepage Vallee"
comment
-- "--"
comment_content " @submodule mouse"
comment
-- "--"
comment_content "------------------------------------------------------------"...
variable_declaration
local "local"
assignment_statement
variable_list
identifier "aplace"
= "="
expression_list
function_call
identifier "require"
arguments
( "("
string
" "\""
string_content "awful.placement"
" "\""
) ")"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "capi"
= "="
expression_list
table_constructor
{ "{"
field
identifier "mousegrabber"
= "="
identifier "mousegrabber"
, ","
field
identifier "client"
= "="
identifier "client"
} "}"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "beautiful"
= "="
expression_list
function_call
identifier "require"
arguments
( "("
string
" "\""
string_content "beautiful"
" "\""
) ")"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "floating"
= "="
expression_list
function_call
identifier "require"
arguments
( "("
string
" "\""
string_content "awful.layout.suit.floating"
" "\""
) ")"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "module"
= "="
expression_list
table_constructor
{ "{"
} "}"
variable_declaration
local "local"
assignment_statement
variable_list
identifier "mode"
= "="
expression_list
string
" "\""
string_content "live"
" "\""
variable_declaration
local "local"
assignment_statement
variable_list
identifier "req"
= "="
expression_list
string
" "\""
string_content "request::geometry"
" "\""
variable_declaration (+30 nodes collapsed)
variable_declaration (+140 nodes collapsed)
comment
-- "--"
comment_content "- Set the resize mode."
comment
-- "--"
comment_content " The available modes are:"
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " * **live**: Resize the layout everytime the mouse moves."
comment
-- "--"
comment_content " * **after**: Resize the layout only when the mouse is relea"...
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " Some clients, such as XTerm, may lose information if resize"...
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " @function awful.mouse.resize.set_mode"
comment
-- "--"
comment_content " @tparam string m The mode"
function_declaration (+39 nodes collapsed)
comment
-- "--"
comment_content "- Add an initialization callback."
comment
-- "--"
comment_content " This callback will be executed before the mouse grabbing st"...
comment
-- "--"
comment_content " @function awful.mouse.resize.add_enter_callback"
comment
-- "--"
comment_content " @tparam function cb The callback (or nil)"
comment
-- "--"
comment_content " @tparam[opt=\"other\"] string context The callback context"
function_declaration (+69 nodes collapsed)
comment
-- "--"
comment_content "- Add a \"move\" callback."
comment
-- "--"
comment_content " This callback is executed in \"after\" mode (see `set_mode`) "...
comment
-- "--"
comment_content " applying the operation."
comment
-- "--"
comment_content " @function awful.mouse.resize.add_move_callback"
comment
-- "--"
comment_content " @tparam function cb The callback (or nil)"
comment
-- "--"
comment_content " @tparam[opt=\"other\"] string context The callback context"
function_declaration (+69 nodes collapsed)
comment
-- "--"
comment_content "- Add a \"leave\" callback"
comment
-- "--"
comment_content " This callback is executed just before the `mousegrabber` st"...
comment
-- "--"
comment_content " @function awful.mouse.resize.add_leave_callback"
comment
-- "--"
comment_content " @tparam function cb The callback (or nil)"
comment
-- "--"
comment_content " @tparam[opt=\"other\"] string context The callback context"
function_declaration (+69 nodes collapsed)
comment
-- "--"
comment_content "- Resize the drawable."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " Valid `args` are:"
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " * *enter_callback*: A function called before the `mousegrab"...
comment
-- "--"
comment_content " * *move_callback*: A function called when the mouse moves."
comment
-- "--"
comment_content " * *leave_callback*: A function called before the `mousegrab"...
comment
-- "--"
comment_content " * *mode*: The resize mode."
comment
-- "--"
comment_content ""
comment
-- "--"
comment_content " @function awful.mouse.resize"
comment
-- "--"
comment_content " @tparam client client A client."
comment
-- "--"
comment_content " @tparam[opt=mouse.resize] string context The resizing conte"...
comment
-- "--"
comment_content " @tparam[opt={}] table args A set of `awful.placement` argum"...
comment
-- "--"
comment_content " @request wibox geometry mouse.resize granted Requests to re"...
comment
-- "--"
comment_content " @usebeautiful beautiful.cursor_mouse_move"
comment
-- "--"
comment_content " @usebeautiful beautiful.cursor_mouse_resize"
function_declaration (+821 nodes collapsed)
function_declaration (+162 nodes collapsed)
function_call
dot_index_expression
dot_index_expression
identifier "capi"
. "."
identifier "client"
. "."
identifier "connect_signal"
arguments
( "("
string
" "\""
string_content "request::geometry"
" "\""
, ","
dot_index_expression
identifier "module"
. "."
identifier "_resize_handler"
) ")"
return_statement
return "return"
expression_list
function_call
identifier "setmetatable"
arguments
( "("
identifier "module"
, ","
table_constructor
{ "{"
field
identifier "__call"
= "="
identifier "handler"
} "}"
) ")"
comment
-- "--"
comment_content " vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabs"...