Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lite XL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andy Nichols
Lite XL
Commits
1b2fda28
Commit
1b2fda28
authored
4 years ago
by
rxi
Browse files
Options
Downloads
Patches
Plain Diff
Changed block movement to mimic word movement
parent
9c652086
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
data/core/commands/doc.lua
+2
-2
2 additions, 2 deletions
data/core/commands/doc.lua
data/core/doc/translate.lua
+8
-8
8 additions, 8 deletions
data/core/doc/translate.lua
data/core/keymap.lua
+4
-4
4 additions, 4 deletions
data/core/keymap.lua
with
14 additions
and
14 deletions
data/core/commands/doc.lua
+
2
−
2
View file @
1b2fda28
...
...
@@ -322,8 +322,8 @@ local translations = {
[
"next-char"
]
=
translate
.
next_char
,
[
"previous-word-start"
]
=
translate
.
previous_word_start
,
[
"next-word-end"
]
=
translate
.
next_word_end
,
[
"previous-
start-of-block
"
]
=
translate
.
previous_
start_of_block
,
[
"next-
start-of-
block"
]
=
translate
.
next_
start_of_
block
,
[
"previous-
block-start
"
]
=
translate
.
previous_
block_start
,
[
"next-block
-end
"
]
=
translate
.
next_block
_end
,
[
"start-of-doc"
]
=
translate
.
start_of_doc
,
[
"end-of-doc"
]
=
translate
.
end_of_doc
,
[
"start-of-line"
]
=
translate
.
start_of_line
,
...
...
This diff is collapsed.
Click to expand it.
data/core/doc/translate.lua
+
8
−
8
View file @
1b2fda28
...
...
@@ -85,30 +85,30 @@ function translate.end_of_word(doc, line, col)
end
function
translate
.
previous_
start_of_block
(
doc
,
line
,
col
)
function
translate
.
previous_
block_start
(
doc
,
line
,
col
)
while
true
do
line
=
line
-
1
if
line
<=
1
then
return
1
,
1
end
if
doc
.
lines
[
line
-
1
]:
match
(
"^%s*$"
)
and
not
doc
.
lines
[
line
]:
match
(
"^%s*$"
)
then
if
doc
.
lines
[
line
-
1
]:
find
(
"^%s*$"
)
and
not
doc
.
lines
[
line
]:
find
(
"^%s*$"
)
then
return
line
,
(
doc
.
lines
[
line
]:
find
(
"%S"
))
end
end
end
function
translate
.
next_
start_of_
block
(
doc
,
line
,
col
)
function
translate
.
next_block
_end
(
doc
,
line
,
col
)
while
true
do
line
=
line
+
1
if
line
>=
#
doc
.
lines
then
return
#
doc
.
lines
,
1
end
if
doc
.
lines
[
line
-
1
]:
match
(
"^%s*$"
)
and
not
doc
.
lines
[
line
]:
match
(
"^%s*$"
)
then
return
line
,
(
doc
.
lines
[
line
]:
find
(
"%S"
))
if
doc
.
lines
[
line
+
1
]:
find
(
"^%s*$"
)
and
not
doc
.
lines
[
line
]:
find
(
"^%s*$"
)
then
return
line
+
1
,
#
doc
.
lines
[
line
+
1
]
end
line
=
line
+
1
end
end
...
...
This diff is collapsed.
Click to expand it.
data/core/keymap.lua
+
4
−
4
View file @
1b2fda28
...
...
@@ -157,8 +157,8 @@ keymap.add {
[
"down"
]
=
{
"command:select-next"
,
"doc:move-to-next-line"
},
[
"ctrl+left"
]
=
"doc:move-to-previous-word-start"
,
[
"ctrl+right"
]
=
"doc:move-to-next-word-end"
,
[
"ctrl+["
]
=
"doc:move-to-previous-
start-of-block
"
,
[
"ctrl+]"
]
=
"doc:move-to-next-
start-of-
block"
,
[
"ctrl+["
]
=
"doc:move-to-previous-
block-start
"
,
[
"ctrl+]"
]
=
"doc:move-to-next-block
-end
"
,
[
"home"
]
=
"doc:move-to-start-of-line"
,
[
"end"
]
=
"doc:move-to-end-of-line"
,
[
"ctrl+home"
]
=
"doc:move-to-start-of-doc"
,
...
...
@@ -172,8 +172,8 @@ keymap.add {
[
"shift+down"
]
=
"doc:select-to-next-line"
,
[
"ctrl+shift+left"
]
=
"doc:select-to-previous-word-start"
,
[
"ctrl+shift+right"
]
=
"doc:select-to-next-word-end"
,
[
"ctrl+shift+["
]
=
"doc:select-to-previous-
start-of-block
"
,
[
"ctrl+shift+]"
]
=
"doc:select-to-next-
start-of-
block"
,
[
"ctrl+shift+["
]
=
"doc:select-to-previous-
block-start
"
,
[
"ctrl+shift+]"
]
=
"doc:select-to-next-block
-end
"
,
[
"shift+home"
]
=
"doc:select-to-start-of-line"
,
[
"shift+end"
]
=
"doc:select-to-end-of-line"
,
[
"ctrl+shift+home"
]
=
"doc:select-to-start-of-doc"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment