Compare commits

...

7 Commits

Author SHA1 Message Date
Jorge Morante 9b393e5757 updated CHANGELOG.md 2024-05-02 16:52:38 +02:00
Jorge Morante 27c5512bc2 bump version in shard.yml 2024-05-02 16:52:14 +02:00
Jorge Morante 2996ef2644 fix dev/release script 2024-05-02 16:51:50 +02:00
Jorge Morante 3c7c6a8673 shitty dev/release script 2024-05-02 16:48:45 +02:00
Morantron 03f0048468
Merge pull request #119 from Avimitin/master
put user defined configs to the front of the list
2024-05-02 15:25:51 +02:00
Avimitin 7e693d40cd
put user defined configs to the front of the list
Signed-off-by: Avimitin <dev@avimit.in>
2024-04-29 17:00:09 +08:00
Jorge Morante 4d3fa1eb30 fix blank screen under certain circumstances due to incorrect handling of capture groups 2024-04-05 12:04:33 +02:00
5 changed files with 93 additions and 10 deletions

View File

@ -1,3 +1,8 @@
## 2.1.5 - 02 May 2024
* User defined patterns now take precedence over built-in ones.
* Fix blank screen under certain circumstances due to incorrect handling of capture groups.
## 2.1.4 - 08 Mar 2024
* Fixed "No last pane" error when using "tmux last-pane" ( Fixes #48 )

77
dev/release.cr Normal file
View File

@ -0,0 +1,77 @@
require "semantic_version"
require "yaml"
struct ShardFile
include YAML::Serializable
include YAML::Serializable::Unmapped
property version : String
end
current_version = SemanticVersion.parse(`shards version`.chomp)
current_branch = `git symbolic-ref --short HEAD`.chomp
pending_changes = `git status -s`.chomp
if current_branch != "develop"
puts "This script should be ran from develop branch"
exit 1
end
if pending_changes != ""
puts "There are uncommited changes"
exit 1
end
puts "Which component you want to bump? major.minor.patch"
print "> "
component = gets
puts "Bumping #{component} in #{current_version}"
next_version = case component
when "major"
current_version.bump_major
when "minor"
current_version.bump_minor
when "patch"
current_version.bump_patch
else
current_version.bump_patch
end
shard = ShardFile.from_yaml(File.read("shard.yml"))
shard.version = next_version.to_s
File.write("shard.yml", shard.to_yaml)
current_date = Time.local.to_s("%d %b %Y")
`git add shard.yml`
`git commit -am "bump version in shard.yml"`
content_to_prepend = "## #{next_version.to_s} - #{current_date}\n\nEDIT THIS:\n\n#{`git log --oneline #{current_version}..@`.chomp}\n\n"
original_content = File.read("CHANGELOG.md")
File.write("CHANGELOG.md", content_to_prepend + original_content)
Process.run(ENV["EDITOR"], args: ["CHANGELOG.md"], input: :inherit, output: :inherit, error: :inherit)
`git add CHANGELOG.md`
`git commit -am 'updated CHANGELOG.md'`
print "Confirm release? [Y/n]\n >"
answer = gets
if answer == "n"
puts "Canceling release"
exit 1
end
`git checkout master`
`git merge develop`
`git tag #{next_version.to_s}`
puts "Run the following command to push the release"
puts ""
puts "git push && git push --tags"

View File

@ -1,13 +1,10 @@
---
version: 2.1.5
name: fingers
version: 2.1.4
authors:
- Jorge Morante <jorge@morante.eu>
- Jorge Morante <jorge@morante.eu>
targets:
tmux-fingers:
main: src/fingers.cr
crystal: 1.11.2
license: MIT

View File

@ -75,8 +75,8 @@ class Fingers::Commands::LoadConfig < Fingers::Commands::Base
end
config.patterns = clean_up_patterns([
*enabled_default_patterns,
*user_defined_patterns,
*enabled_default_patterns,
])
config.alphabet = ::Fingers::Config::ALPHABET_MAP[Fingers.config.keyboard_layout].split("").reject do |char|

View File

@ -106,7 +106,7 @@ module Fingers
def replace(match, line_index)
text = match[0]
captured_text = match["match"]? || text
captured_text = captured_text_for_match(match)
relative_capture_offset = relative_capture_offset_for_match(match, captured_text)
absolute_offset = {
@ -114,7 +114,7 @@ module Fingers
match.begin(0) + (relative_capture_offset ? relative_capture_offset[0] : 0)
}
hint = hint_for_text(text)
hint = hint_for_text(captured_text)
build_target(captured_text, hint, absolute_offset)
if !state.input.empty? && !hint.starts_with?(state.input)
@ -129,6 +129,10 @@ module Fingers
)
end
def captured_text_for_match(match)
match["match"]? || match[0]
end
def hint_for_text(text)
return pop_hint! unless reuse_hints
@ -195,7 +199,7 @@ module Fingers
lines.each do |line|
line.scan(pattern) do |match|
match_set.add(match[0]?.not_nil!)
match_set.add(captured_text_for_match(match))
end
end